[issue42238] Deprecate suspicious.py?

2022-02-09 Thread Julien Palard


Julien Palard  added the comment:


New changeset b878b3af0b3a9e3ab3ffcaf90a4066dfb3bb7cac by Julien Palard in 
branch 'main':
bpo-42238: [doc] moving from rstlint.py to sphinx-lint. (GH-31097)
https://github.com/python/cpython/commit/b878b3af0b3a9e3ab3ffcaf90a4066dfb3bb7cac


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45393] help() on operator precedence has confusing entries "await" "x" and "not" "x"

2022-02-09 Thread Zackery Spytz


Zackery Spytz  added the comment:

I have created a patch for this issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45393] help() on operator precedence has confusing entries "await" "x" and "not" "x"

2022-02-09 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 5.0 -> 6.0
pull_requests: +29415
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31246

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21910] [doc] File protocol should document if writelines must handle generators sensibly

2022-02-09 Thread Stanley


Change by Stanley :


--
keywords: +patch
pull_requests: +29414
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/31245

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger


Change by Raymond Hettinger :


Added file: https://bugs.python.org/file50615/instrument_issubset.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger


Change by Raymond Hettinger :


Removed file: https://bugs.python.org/file50614/instrument_issubset.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger


Change by Raymond Hettinger :


Removed file: https://bugs.python.org/file50613/instrument_issubset.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I've run a few more experiments and this looks like a net win more often than 
not.  Go ahead and submit a PR so we can evaluate it further.

--
Added file: https://bugs.python.org/file50614/instrument_issubset.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

We care more about the running speed than the memory usage.  Since sets only 
store pointers to data, they are typically smaller than the data they refer to.

I've attached some instrumentation code for running experiments to verify the 
workload under various scenarios.

--
Added file: https://bugs.python.org/file50613/instrument_issubset.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45923] Improve performance of sys.settracing based tools.

2022-02-09 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher
nosy_count: 3.0 -> 4.0
pull_requests: +29413
pull_request: https://github.com/python/cpython/pull/31244

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks Anthony for the report!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9b23f8f78fdb0d7eba016616ae7a97abbfc65aa6 by Pablo Galindo Salgado 
in branch '3.10':
[3.10] bpo-46707: Avoid potential exponential backtracking in some syntax 
errors (GH-31241). (GH-31242)
https://github.com/python/cpython/commit/9b23f8f78fdb0d7eba016616ae7a97abbfc65aa6


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
versions:  -Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +29412
pull_request: https://github.com/python/cpython/pull/31242

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset b71dc71905ab674ccaa4a56230d17a28f61c325c by Pablo Galindo Salgado 
in branch 'main':
bpo-46707: Avoid potential exponential backtracking in some syntax errors 
(GH-31241)
https://github.com/python/cpython/commit/b71dc71905ab674ccaa4a56230d17a28f61c325c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-02-09 Thread Gregory Beauregard


Gregory Beauregard  added the comment:

I wrote a PR that fixes the underlying issue here, but I'm leaving it as a 
draft while the discussion plays out. I think the stuff currently in the patch 
should be okay regardless of the discussion decision, because the underlying 
issue is that P.args and P.kwargs didn't pass typing._type_check, which is 
needed for reasons unrelated to Annotated (such as if they were stringified and 
had get_type_hints called on them).

If the result of the discussion is that we need to start supporting limitations 
on where Annotated is used, I'll add another PR that introduces support for 
this pattern in whatever locations that are decided it shouldn't be allowed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +29411
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31241

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread anthony shaw


Change by anthony shaw :


--
versions: +Python 3.10, Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread anthony shaw


New submission from anthony shaw :

Providing an (invalid) input to the parser causes an exponentially-slow DoS to 
the Python executable in 3.10.

e.g.

python3.10 -c "{:"

takes ~2 seconds

python3.10 -c ":"

takes ~22 seconds

Tested this all the way up to 
d```{{{ef f():y

which took over an hour

--
components: Parser
keywords: 3.10regression
messages: 412972
nosy: anthonypjshaw, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Parser hanging on stacked { tokens
type: crash

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The contract of that interface is to receive null-terminated strings, so I am a 
bit clueless on how this could receive a non-null terminated string.

Notice that calling PyRun_StringFlags with a non-null terminated string is out 
of contract.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
Removed message: https://bugs.python.org/msg412970

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The contract of that interface is to receive null-terminated strings, so I am a 
bit clueless on how this could receive a non-null terminated string.

Notice that calling CompileCode with a non-null terminated string is out of 
contract.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Could you please provide an example input to reproduce this?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread Eryk Sun


Eryk Sun  added the comment:

> True == False == False is really True == False and False == False 
> wich is False and True which is False

Moreover, since the left-hand comparison is `True == False`, which evaluates to 
False, the right-hand comparison doesn't even get evaluated. 

In the following example, print(3) doesn't get called because the left-hand 
comparison, `None != None`, is False:

>>> print(1) != print(2) == print(3)
1
2
False

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46706] AxelRacer

2022-02-09 Thread Dennis Sweeney


New submission from Dennis Sweeney :

I'm closing this -- if you found a bug in Python, please be sure to describe 
thoroughly what bug you found, steps to reproduce the bug, and what behavior 
you expected.

--
nosy: +Dennis Sweeney
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
nosy: +rhettinger, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46706] AxelRacer

2022-02-09 Thread claude-alexandre cabana


Change by claude-alexandre cabana :


--
components: Build
nosy: claudealexcabana
priority: normal
severity: normal
status: open
title: AxelRacer
type: performance
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Jack Nguyen


New submission from Jack Nguyen :

I noticed that the set.issubset cpython implementation casts its iterable 
argument to a set. In some cases, casting the whole iterable to a set is 
unnecessary (see https://bugs.python.org/issue18032). Although the latter 
suggestion is to perform early termination, my suggestion is to use the 
intersection instead.

# PyAnySet_Check coming from the cpython source code.
def issubset(self, other):
# Intersection suggestion:
if not PyAnySet_Check(other):
return len(self.intersection(other)) == len(self)
# Usual implementation for sets.
else:
return ...

The main advantage that this implementation has is its memory performance, 
using only O(min(len(self), len(other))) memory, since it never stores elements 
it does not need.

I'm assuming that set construction costs O(n) set.__contains__ calls. This 
implementation uses len(other) calls to self.__contains__ and tmp.__contains__, 
where tmp = set(other). The current implementation uses len(self) + len(other) 
calls to tmp.__contains__.

Thus, I suspect the current implementation only has a chance at running 
noticeably faster when len(self) << len(other), where it performs fewer calls 
to set.__contains__. This is, however, also where the proposed implementation 
has significantly superior memory performance.

--
components: Interpreter Core
messages: 412966
nosy: panda1200
priority: normal
severity: normal
status: open
title: Memory optimization for set.issubset
type: performance
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread anthony shaw


New submission from anthony shaw :

In tokenizer.c, the translate_newlines() function does a `strlen()` on the 
input string, if the string is not null-terminated, e.g. 
'\xbe' this leads to a heap-buffer-overflow. The overflow is not exploitable, 
but if there are further changes to the parser, it might be worth using a 
strlen() alternative, like strnlen().

static char *
translate_newlines(const char *s, int exec_input, struct tok_state *tok) {
int skip_next_lf = 0;
size_t needed_length = strlen(s) + 2, final_length;


This leads to a heap-buffer-overflow detected by ASAN in a simple reproducible 
example, calling PyRun_StringFlags() from the LLVM fuzzer:


fuzz_target(47084,0x11356f600) malloc: nano zone abandoned due to inability to 
preallocate reserved vm space.
Dictionary: 35 entries
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 3034498392
INFO: Loaded 1 modules   (43 inline 8-bit counters): 43 [0x10a2b71e8, 
0x10a2b7213), 
INFO: Loaded 1 PC tables (43 PCs): 43 [0x10a2b7218,0x10a2b74c8), 
INFO:1 files found in ../Tests/fuzzing/corpus
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 
4096 bytes
=
==47084==ERROR: AddressSanitizer: heap-buffer-overflow on address 
0x60203131 at pc 0x00010bd1d555 bp 0x7ff7b5da0590 sp 0x7ff7b5d9fd50
READ of size 2 at 0x60203131 thread T0
#0 0x10bd1d554 in wrap_strlen+0x184 
(libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x15554)
#1 0x10b12132b in translate_newlines+0x1b (Python:x86_64+0x5d32b)
#2 0x10b12071c in _PyParser_ASTFromString+0x1ac (Python:x86_64+0x5c71c)
#3 0x10b2f86de in PyRun_StringFlags+0x5e (Python:x86_64+0x2346de)
#4 0x10a25ec6b in CompileCode(char const*) fuzz_target.cpp:54
#5 0x10a25f247 in LLVMFuzzerTestOneInput fuzz_target.cpp:68
#6 0x10a27aff3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, 
unsigned long) FuzzerLoop.cpp:611
#7 0x10a27c3c4 in 
fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__1::vector >&) FuzzerLoop.cpp:804
#8 0x10a27c859 in fuzzer::Fuzzer::Loop(std::__1::vector >&) FuzzerLoop.cpp:857
#9 0x10a26aa5f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char 
const*, unsigned long)) FuzzerDriver.cpp:906
#10 0x10a298e42 in main FuzzerMain.cpp:20
#11 0x1134f44fd in start+0x1cd (dyld:x86_64+0x54fd)

0x60203131 is located 0 bytes to the right of 1-byte region 
[0x60203130,0x60203131)
allocated by thread T0 here:
#0 0x10bd58a0d in wrap__Znam+0x7d 
(libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x50a0d)
#1 0x10a27af02 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, 
unsigned long) FuzzerLoop.cpp:596
#2 0x10a27c3c4 in 
fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__1::vector >&) FuzzerLoop.cpp:804
#3 0x10a27c859 in fuzzer::Fuzzer::Loop(std::__1::vector >&) FuzzerLoop.cpp:857
#4 0x10a26aa5f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char 
const*, unsigned long)) FuzzerDriver.cpp:906
#5 0x10a298e42 in main FuzzerMain.cpp:20
#6 0x1134f44fd in start+0x1cd (dyld:x86_64+0x54fd)

SUMMARY: AddressSanitizer: heap-buffer-overflow 
(libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x15554) in wrap_strlen+0x184
Shadow bytes around the buggy address:
  0x1c0405d0: fa fa 02 fa fa fa 02 fa fa fa 02 fa fa fa 02 fa
  0x1c0405e0: fa fa 02 fa fa fa 02 fa fa fa 02 fa fa fa 02 fa
  0x1c0405f0: fa fa 03 fa fa fa 03 fa fa fa 03 fa fa fa 03 fa
  0x1c040600: fa fa 01 fa fa fa 01 fa fa fa 01 fa fa fa 01 fa
  0x1c040610: fa fa 00 00 fa fa 00 fa fa fa 00 fa fa fa 00 00
=>0x1c040620: fa fa 00 fa fa fa[01]fa fa fa fd fa fa fa fd fd
  0x1c040630: fa fa fd fa fa fa fd fa fa fa 00 fa fa fa 04 fa
  0x1c040640: fa fa 00 00 fa fa 01 fa fa fa 01 fa fa fa 01 fa
  0x1c040650: fa fa fd fa fa fa fd fa fa fa fd fd fa fa 01 fa
  0x1c040660: fa fa 00 00 fa fa 01 fa fa fa fd fa fa fa fd fa
  0x1c040670: fa fa 01 fa fa fa 06 fa fa fa 00 00 fa fa 06 fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:   fa
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack after return:  f5
  Stack use after scope:   f8
  Global redzone:  f9
  Global init order:   f6
  Poisoned by user:f7
  Container overflow:  fc
  Array cookie:ac
  Intra object redzone:bb
  ASan internal:   fe
  Left alloca redzone: ca
  Right alloca redzone:cb
  Shadow gap:  cc
==47084==ABORTING
MS: 0 ; base unit: 


artifact_prefix='./'; Test unit written to 
./crash-da39a3ee5e6b4b0d3255bfef95601890afd80709
Base64: 
zsh: abort  ./fuzz_target -dict=../Tests/fuzzing/python.dict -only_ascii=1

--
components: Parser
messages: 

[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is not a bug. Please check the docs on the ternary operator:

https://docs.python.org/3/reference/expressions.html#comparisons

In particular:

Comparisons can be chained arbitrarily, e.g., x < y <= z is equivalent to x < y 
and y <= z, except that y is evaluated only once (but in both cases z is not 
evaluated at all when x < y is found to be false).



THis means that

True == False == False is really True == False and False == False wich is False 
and True which is False

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
Removed message: https://bugs.python.org/msg412963

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is not a bug. Please check the docs on the ternary operator:

https://docs.python.org/3/reference/expressions.html#comparisons

In particular:

Comparisons can be chained arbitrarily, e.g., x < y <= z is equivalent to x < y 
and y <= z, except that y is evaluated only once (but in both cases z is not 
evaluated at all when x < y is found to be false).



THis means that

True == False == False is really True == False and True == False wich is False 
and False which is False

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46702] Specialize UNPACK_SEQUENCE

2022-02-09 Thread Brandt Bucher


Brandt Bucher  added the comment:

(I also plan on looking into an adaptive super-duper-instruction for 
UNPACK_SEQUENCE_TWO_TUPLE__STORE_FAST__STORE_FAST after the current PR has 
landed).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread jung mo sohn


New submission from jung mo sohn :

In python 3.6.8, 3.7.3, 3.7.4, 3.7.5, 3.7.12, 3.8.8 versions, the output is 
False as shown below.

Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print(True == False == False)
False

However, in the openjdk1.8 version, the output is "true" as shown below. 

public class Test {
public static void main(String[] args) throws Exception{
System.out.println(true == false == false);
}
}

> java Test
true

In my opinion, "True" seems to be correct.

--
components: Parser
messages: 412961
nosy: jmsohn.x, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: boolean operation issue (True == False == False)
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46702] Specialize UNPACK_SEQUENCE

2022-02-09 Thread Brandt Bucher


Change by Brandt Bucher :


--
keywords: +patch
pull_requests: +29410
pull_request: https://github.com/python/cpython/pull/31240

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46702] Specialize UNPACK_SEQUENCE

2022-02-09 Thread Brandt Bucher


New submission from Brandt Bucher :

UNPACK_SEQUENCE already has fast paths for tuples and lists, which make up 
(literally) 99% of unpackings in the benchmark suite. What's more, two-element 
tuples make up about two-thirds of all unpackings (though I actually suspect 
it's even higher, since the unpack_sequence benchmark is definitely skewing the 
results towards 10-element lists and tuples).

These specializations are trivial to implement and result in a solid 1% 
improvement overall.

--
assignee: brandtbucher
components: Interpreter Core
messages: 412960
nosy: Mark.Shannon, brandtbucher
priority: normal
severity: normal
stage: patch review
status: open
title: Specialize UNPACK_SEQUENCE
type: performance
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46691] sysconfig.get_platform() raises ValueError on macOS if '-arch' is present in CFLAGS but doesn't refer to the '-arch' compiler flag

2022-02-09 Thread Ned Deily


Change by Ned Deily :


--
Removed message: https://bugs.python.org/msg412958

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46691] sysconfig.get_platform() raises ValueError on macOS if '-arch' is present in CFLAGS but doesn't refer to the '-arch' compiler flag

2022-02-09 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report; I don't recall this coming up before. Of course, the 
easy workaround is to avoid using "-arch" in CFLAGS paths and the like, but we 
should fix this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46691] sysconfig.get_platform() raises ValueError on macOS if '-arch' is present in CFLAGS but doesn't refer to the '-arch' compiler flag

2022-02-09 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report; I don't recall this coming up before. Of course, the 
easy workaround is to avoid using "arch" in CFLAGS paths and the like, but we 
should fix this.

--
components: +macOS
nosy: +ned.deily, ronaldoussoren
type: crash -> compile error
versions: +Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36876] [subinterpreters] Global C variables are a problem

2022-02-09 Thread Eric Snow


Eric Snow  added the comment:


New changeset cb68788dcadf43b47292bab7816a5ed9efa69730 by Eric Snow in branch 
'main':
bpo-36876: Minor cleanup to c-analyzer "ignored" data.' (gh-31239)
https://github.com/python/cpython/commit/cb68788dcadf43b47292bab7816a5ed9efa69730


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40255] Fixing Copy on Writes from reference counting and immortal objects

2022-02-09 Thread Eric Snow


Eric Snow  added the comment:

@Eddie, what can I do to push this forward?  FYI, in addition to the python-dev 
thread a few weeks back, I've brought the matter up with the steering council. 
[1]

Also, if we can get back to performance-neutral (currently at about 4% slower) 
then there would be a lot less controversy.  Even at 2% it may be enough.


[1] https://github.com/python/steering-council/issues/103

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46701] cannot use typographical quotation marks in bug description

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Please report bug tracker bugs at https://github.com/python/bugs.python.org

Although to be honest I doubt this will be fixed, since we're moving to Github 
issues.

--
nosy: +eric.smith
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36876] [subinterpreters] Global C variables are a problem

2022-02-09 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +29409
pull_request: https://github.com/python/cpython/pull/31239

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46528] Simplify the VM's stack manipulations

2022-02-09 Thread Brandt Bucher


Change by Brandt Bucher :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46528] Simplify the VM's stack manipulations

2022-02-09 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 78ae4cc6dc949e8bc39fab25fea5efe983dc0ad1 by Brandt Bucher in 
branch 'main':
bpo-46528: Attempt SWAPs at compile-time (GH-30970)
https://github.com/python/cpython/commit/78ae4cc6dc949e8bc39fab25fea5efe983dc0ad1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-02-09 Thread Gregory Beauregard


Change by Gregory Beauregard :


--
keywords: +patch
pull_requests: +29408
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31238

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46701] cannot use typographical quotation marks in bug description

2022-02-09 Thread mirabilos


New submission from mirabilos :

When trying to use typographical quotation marks (U+201C, U+201D) in the 
Comment field trying to submit a bug here, I get a red-background error message 
saying:

Error: 'utf8' codec can't decode bytes in position 198-199: invalid 
continuation byte

--
messages: 412953
nosy: mirabilos
priority: normal
severity: normal
status: open
title: cannot use typographical quotation marks in bug description

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46700] wrong nomenclature (options vs. arguments) in argparse

2022-02-09 Thread mirabilos

New submission from mirabilos :

The argparse documentation and tutorial as well as its default option groups 
speak of "positional arguments" and "optional arguments". These are not used 
correctly, though.

Elements of the argument vector (past item #0) are distinguished as options and 
(positional) arguments.

Options are either flags (ls "-l", cmd "/c") or GNU long options ("--help"). 
They are usually optional ("[-h]") but may be mandatory (such as -o/-i/-p for 
cpio(1)). They may have option arguments (cpio(1) "-H format").

Arguments (also called positional arguments) may be mandatory ("file") or 
optional ("[file]"). They are also called operands (mostly in POSIX, not very 
common).

The argparse documentation confused the hell out of me at first because I only 
saw argument documentation and could not find option documentation…

--
components: Library (Lib)
messages: 412952
nosy: mirabilos
priority: normal
severity: normal
status: open
title: wrong nomenclature (options vs. arguments) in argparse
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'll close it.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46697] _ctypes_simple_instance returns inverted logic

2022-02-09 Thread Eryk Sun


Change by Eryk Sun :


--
stage:  -> patch review
versions:  -Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46697] _ctypes_simple_instance returns inverted logic

2022-02-09 Thread hydroflask


hydroflask  added the comment:

I place that patch into the public domain, I claim no ownership over that 
patch. The patch is attached purely for demonstration purposes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46697] _ctypes_simple_instance returns inverted logic

2022-02-09 Thread hydroflask


New submission from hydroflask :

`_ctypes_simple_instance` in _ctypes.c returns the opposite logic of what its 
documentation claims. It is supposed to return true when the argument (a type 
object) is a direct subclass of `Simple_Type` (`_SimpleCData` in Python code). 
However it returns false instead.

No bugs have manifested from this because all of the call sites ( 
`callproc.c::GetResult`, 
`callbacks.c::_CallPythonObject`,_`ctypes.c::PyCData_get`, 
`_ctypes.c::Simple_from_outparm`) invert the return value of this function. The 
last example, `ctypes.c::Simple_from_outparm` only calls `Simple_get_value()` 
when `_ctypes_simple_instance` returns false, which makes sense because 
otherwise the invocation of `_ctypes.c::Simple_from_outparm()` could trigger an 
assertion error.

This is not just simply an issue of inverted logic because the logic isn't 
inverted in all cases. In `_ctypes_simple_instance` in the case when 
`PyCSimpleTypeObject_Check(type)` returns false, if this were supposed to be 
perfect inverted logic then the whole routine would return 1 (True) not 0. 
Fortunately, due to the way the code is structured, I don't think there is a 
case when `PyCSimpleTypeObject_Check(type)` returns false so the incorrect case 
where it returns a constant 0 is effectively dead code.

I have compiled a version of Python with the attached patch and run "make test" 
with no issues.

--
components: ctypes
files: _ctypes_simple_instance_inverted.patch
keywords: patch
messages: 412947
nosy: hydroflask
priority: normal
severity: normal
status: open
title: _ctypes_simple_instance returns inverted logic
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9
Added file: 
https://bugs.python.org/file50612/_ctypes_simple_instance_inverted.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, Henry Schreiner!

--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46696] socketmodule add Linux SO_INCOMING_CPU constant

2022-02-09 Thread David CARLIER


New submission from David CARLIER :

Adding Linux's SO_INCOMING_CPU constant for setsockopt.

--
components: +Library (Lib)
keywords: +patch
message_count: None -> 1.0
pull_requests: +29407
stage:  -> patch review
title: socketmodule add Linux SO_INCOMING_CPU constasn -> socketmodule add 
Linux SO_INCOMING_CPU constant
type:  -> enhancement
pull_request: https://github.com/python/cpython/pull/31237

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46696] socketmodule add Linux SO_INCOMING_CPU constasn

2022-02-09 Thread David CARLIER


Change by David CARLIER :


--
nosy: devnexen
priority: normal
severity: normal
status: open
title: socketmodule add Linux SO_INCOMING_CPU constasn

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread miss-islington


miss-islington  added the comment:


New changeset 7445949a4399ab19fbdd5a0b0aca53a690c3251b by Miss Islington (bot) 
in branch '3.10':
bpo-43532: add version added to KW_ONLY (GH-31235)
https://github.com/python/cpython/commit/7445949a4399ab19fbdd5a0b0aca53a690c3251b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29406
pull_request: https://github.com/python/cpython/pull/31236

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread miss-islington


miss-islington  added the comment:


New changeset 5a3f97291eea96037cceee097ebc00bba44bc9ed by Henry Schreiner in 
branch 'main':
bpo-43532: add version added to KW_ONLY (GH-31235)
https://github.com/python/cpython/commit/5a3f97291eea96037cceee097ebc00bba44bc9ed


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-09 Thread hydroflask


hydroflask  added the comment:

For reference, here are MSDN, Linux, OpenBSD, and GCC docs on alloca:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/alloca?view=msvc-170

https://www.man7.org/linux/man-pages/man3/alloca.3.html

https://man.openbsd.org/alloca.3

https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_002a_005f_005fbuiltin_005falloca

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-09 Thread STINNER Victor


STINNER Victor  added the comment:

I failed to find the doc about alloca(0). It seems like the existing 
_ctypes_callproc() function *can* call alloca(0) if argtuple is empty and pIunk 
is 0 (pIunk is specific to Windows).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-09 Thread hydroflask


hydroflask  added the comment:

@corona10

I really hope I am not being annoying at this point :) One final nit, in this 
line:

https://github.com/python/cpython/pull/31224/files#diff-706e65ee28911740bf638707e19578b8182e57c6a8a9a4a91105d825f95a139dR168

You do not have to check if nargs > 0. alloca() can handle the case when nargs 
== 0. The usage of alloca() in callproc.c does not check for nargs > 0 either.

Otherwise thanks for this enhancement!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread Henry Schreiner


Change by Henry Schreiner :


--
nosy: +Henry Schreiner
nosy_count: 9.0 -> 10.0
pull_requests: +29405
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31235

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46528] Simplify the VM's stack manipulations

2022-02-09 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 46328d8ae6529db916ccaabb9247fb0327ce0c1e by Brandt Bucher in 
branch 'main':
bpo-46528: Check PyMem_Malloc for NULL (GH-30998)
https://github.com/python/cpython/commit/46328d8ae6529db916ccaabb9247fb0327ce0c1e


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46694] isdigit/isnumeric vs int()

2022-02-09 Thread Mark Dickinson


Change by Mark Dickinson :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46694] isdigit/isnumeric vs int()

2022-02-09 Thread Mark Dickinson

Mark Dickinson  added the comment:

This is by design: int looks for characters with the Unicode Decimal (De) 
numeric type, corresponding to str.isdecimal(), rather than for the Digit (Di) 
or Numeric (Nu) numeric types.

>>> "²".isdecimal()
False

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46072] Unify handling of stats in the CPython VM

2022-02-09 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29404
pull_request: https://github.com/python/cpython/pull/31234

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46430] intern strings in deepfrozen modules

2022-02-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

We discussed that and found that a lot of errors are ignored during interning 
anyway.

But it's not too late to change if you want to (sending a PR would probably be 
quicker than arguing :-).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-09 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset d18120cd67b4297f78bfc9bf7b36774cf0bf15f2 by Dong-hee Na in branch 
'main':
bpo-46323: Reduce stack usage of ctypes python callback function. (GH-31224)
https://github.com/python/cpython/commit/d18120cd67b4297f78bfc9bf7b36774cf0bf15f2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46695] _io_TextIOWrapper_reconfigure_impl errors out too early

2022-02-09 Thread mirabilos

New submission from mirabilos :

The following is not possible:

with open('/tmp/x.ssv', 'r', newline='\n') as f:
f.readline()
# imagine a library call boundary here
if hasattr(f, 'reconfigure'):
f.reconfigure(newline='\n')

The .reconfigure() call would not do anything, but it errors out nevertheless, 
simply because it is called (from reading the 
_io_TextIOWrapper_reconfigure_impl code in Modules/_io/textio.c).

Unfortunately, I *have* to call this in my library because I have to rely on 
“newline='\n'” behaviour (the hasattr avoids erroring out on binary streams), 
and the normal behaviour of erroring out if it’s too late to change is also 
good for me.

But the behaviour of erroring out if called at all when anything has already 
been read is a problem. This can easily be solved without breaking backwards 
compatibility, as the operation is a nop.

To clarify: I wish for…

with open('/tmp/x.ssv', 'r', newline='\n') as f:
f.readline()
# imagine a library call boundary here
if hasattr(f, 'reconfigure'):
f.reconfigure(newline='\n')

… to work, but for…

with open('/tmp/x.ssv', 'r') as f:
f.readline()
# imagine a library call boundary here
if hasattr(f, 'reconfigure'):
f.reconfigure(newline='\n')

… (line 1 is the only changed one) to continue to error out.

--
components: IO
messages: 412935
nosy: mirabilos
priority: normal
severity: normal
status: open
title: _io_TextIOWrapper_reconfigure_impl errors out too early
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46694] isdigit/isnumeric vs int()

2022-02-09 Thread Nonsense

New submission from Nonsense :

When typing in "²".isdigit() or "²".isnumeric() it gives True
but when typing in int("²") it errors out:
ValueError: invalid literal for int() with base 10: '²'

--
components: Interpreter Core
messages: 412934
nosy: smtplukas.tanner.test
priority: normal
severity: normal
status: open
title: isdigit/isnumeric vs int()
type: behavior
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45413] Add install scheme for virtual environments

2022-02-09 Thread Filipe Laíns

Filipe Laíns  added the comment:

I don't think the proposal is incompatible with what I discussed.

I haven't been super clear on my opinions on the implementation, so let me try 
to clarify them.

- I think that we should use a static scheme, accessible on all platforms.
- If this scheme needs to be independently defined for each platform, we should 
have different variants, available on all platforms, but still keep a generic 
named one, as an alias to the platform specific scheme
- We should not be re-using/aliasing existing schemes, particularly ones that 
are prone to downstream patching

So, my proposal would be to define a single static scheme, and changing the 
interpreter path initialization logic to hardcode its paths when on virtual 
environments.
If this presents any issue, and requires the scheme to be different for 
different platforms, we should add platform specific schemes and make the main 
one an alias to the correct scheme.

Hopefully that clarifies things up a bit. We should sort it out as soon as 
possible and update the PR, I don't think the PR as-is is the best approach.

What do you think?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-09 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Joshua Root for the bug report and the fix!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-09 Thread miss-islington


miss-islington  added the comment:


New changeset b0517a12179a9fe444ca6ce1f31c307883e81c0c by Miss Islington (bot) 
in branch '3.9':
bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693)
https://github.com/python/cpython/commit/b0517a12179a9fe444ca6ce1f31c307883e81c0c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-09 Thread miss-islington


miss-islington  added the comment:


New changeset 42f87d435ebe4f2834c8fd0b4ce38f0b1627f3ed by Miss Islington (bot) 
in branch '3.10':
bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693)
https://github.com/python/cpython/commit/42f87d435ebe4f2834c8fd0b4ce38f0b1627f3ed


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Bruce Eckel


Bruce Eckel  added the comment:

Oops. That does in fact work. How do I remove the bug report?

*Bruce Eckel*
HappyPathProgramming.com
SummerTechForum.com
MindViewLLC.com
Blog: BruceEckel.com
EvolveWork.co
WinterTechForum.com 
OnJava8.com 
www.AtomicKotlin.com
Reinventing-Business.com 

On Wed, Feb 9, 2022 at 10:20 AM Eric V. Smith 
wrote:

>
> Eric V. Smith  added the comment:
>
> I believe dataclasses uses repr() of the members, not str(). Can you try
> using specifying __repr__ in Teacup? Just __repr__ = __str__ should work.
>
> --
> nosy: +eric.smith
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

I believe dataclasses uses repr() of the members, not str(). Can you try using 
specifying __repr__ in Teacup? Just __repr__ = __str__ should work.

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Bruce Eckel


New submission from Bruce Eckel :

When creating a dataclass using members of other classes that have overridden 
their __str__ methods, the __str__ method synthesized by the dataclass ignores 
the overridden __str__ methods in its component members.

Demonstrated in attached file.

--
components: Interpreter Core
files: DataClassStrBug.py
messages: 412927
nosy: Bruce Eckel
priority: normal
severity: normal
status: open
title: dataclass generated __str__ does not use overridden member __str__
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50611/DataClassStrBug.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46689] `list(FunctionType(a.gi_code, {})(0))` crashes Python

2022-02-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also https://bugs.python.org/issue36956

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46494] Mention typing_extensions in the typing documentation

2022-02-09 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Welcome to this project, Meer!

That looks pretty good, feel free to submit a PR. We can then perhaps get 
feedback from more people to improve the wording.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46692] match case does not support regex

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Good catch, @xtreak. I think something like the discussed (but not implemented) 
custom matching protocol would be required here. __match_args__ won't work, 
because it's a special attribute only checked on classes, not instances.

Of course, I'm still not sure this is what the original poster is requesting!

But assuming so, this would require a PEP, and should be discussed with the PEP 
634 authors.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29403
pull_request: https://github.com/python/cpython/pull/31233

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-09 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +29402
pull_request: https://github.com/python/cpython/pull/31232

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bf2d44ffb06e8f49aacc6b1c140a6717df5cf897 by Joshua Root in branch 
'main':
bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693)
https://github.com/python/cpython/commit/bf2d44ffb06e8f49aacc6b1c140a6717df5cf897


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46430] intern strings in deepfrozen modules

2022-02-09 Thread Christian Heimes


Christian Heimes  added the comment:

I noticed that the new interning code lacks proper error reporting. There are 
only asserts. _PyCode_New() checks the return value of intern_strings.

--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46690] create_autospec() doesn't respect configure_mock style kwargs

2022-02-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46692] match case does not support regex

2022-02-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> There were ideas for exotic matchers such as IsInstance(), InRange(), 
> RegexMatchingGroup() and so on.

https://www.python.org/dev/peps/pep-0622/#custom-matching-protocol

The PEP has some mention about a similar use case in custom match protocol 
section.

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46430] intern strings in deepfrozen modules

2022-02-09 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset c0a5ebeb1239020f2ecc199053bb1a70d78841a1 by Kumar Aditya in 
branch 'main':
bpo-46430: Intern strings in deep-frozen modules  (GH-30683)
https://github.com/python/cpython/commit/c0a5ebeb1239020f2ecc199053bb1a70d78841a1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46532] Improve efficiency of PRECALL/CALL instructions

2022-02-09 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +29401
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31231

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46532] Improve efficiency of PRECALL/CALL instructions

2022-02-09 Thread Mark Shannon


Change by Mark Shannon :


--
title: Improve effeciency of PRECALL/CALL instructions -> Improve efficiency of 
PRECALL/CALL instructions

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44289] tarfile.is_tarfile() and tarfile.open() when used with file object may cause tarfile operations to fail

2022-02-09 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 128ab092cad984b73a117f58fa0e9b4105051a04 by Andrzej Mateja in 
branch 'main':
bpo-44289: Keep argument file object's current position in tarfile.is_tarfile 
(GH-26488)
https://github.com/python/cpython/commit/128ab092cad984b73a117f58fa0e9b4105051a04


--
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-09 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46686] [venv / PC/launcher] issue with a space in the installed python path

2022-02-09 Thread Kesh Ikuma


Kesh Ikuma  added the comment:

> a file named "C:\Program". Now the venv launcher won't be able to execute

This is exactly what happened on my PC, and the behavior was triggered by 
Microsoft Visual C++ 2015-2022 Redistributable installer. The installer left a 
log file "C:\Users\Kesh" with my account "C:\Users\Kesh Ikuma".

Thank you for quickly addressing the issue

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2022-02-09 Thread firewave


firewave  added the comment:

Actually "Process Explorer" finds the handle as well. No idea why it didn't 
come up in my last search.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45789] Python execution broken after update via Windows Store

2022-02-09 Thread firewave


firewave  added the comment:

I figured it out.

I tried to delete the files using PowerShell and I got the following:

Remove-Item : Cannot remove item 
C:\Users\Username\AppData\Local\Microsoft\WindowsApps\python.exe: The
process cannot access the file 
'C:\Users\Username\AppData\Local\Microsoft\WindowsApps\python.exe' because it
is being used by another process.

Using the "Resource Monitor" via the "CPU" tab and "Associated Handles" I was 
able the process which was using those. Somehow the handle search in "Process 
Explorer" was not returning this.

After closing the process I was able to remove the files and install Python 
again.

So it is exactly as I suspected before. When an update/uninstall is performed 
and the files are in use they cannot be updated/removed.

It should probably check this early and fail in case the files are in use so it 
doesn't perform a partial operation leaving the app unusable/not installable.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46494] Mention typing_extensions in the typing documentation

2022-02-09 Thread Meer Suri


Meer Suri  added the comment:

(First time contributor looking for guidance) Is this diff okay? I'm not sure 
if the package name should be typing-extensions, or if the formatting is okay

diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 94a46b01a1..c0fe656c1c 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -32,6 +32,11 @@ In the function ``greeting``, the argument ``name`` is 
expected to be of type
 :class:`str` and the return type :class:`str`. Subtypes are accepted as
 arguments.

+New features have been added to the typing module in each major version of
+Python. The `typing_extensions `_
+package provides backports to all supported versions of Python 3 for almost
+all of these features.
+
 .. _relevant-peps:

 Relevant PEPs

--
nosy: +meersuri

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46692] match case does not support regex

2022-02-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

Looking at PEP 634, the obvious way to add support for this is to have the 
re.Match object specify Py_TPFLAGS_MAPPING. But I tried that, and then I get 
this error when using an re.Match object in a match statement:

case {'one': x, 'two': y}:
 
TypeError: object of type 're.Match' has no len()


Add len() to re.Match objects was rejected when __getitem__ was added to 
re.Match, in issue 24454.

I haven't explored other ways to support re.Match objects in the match 
statement.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46685] Add additional tests for new features in `typing.py`

2022-02-09 Thread miss-islington


miss-islington  added the comment:


New changeset bde3765a3fd21e2ecf595a57998b285e3045f744 by Miss Islington (bot) 
in branch '3.9':
bpo-46685: cover `TypeError` of `ForwardRef(1)` in `test_typing` (GH-31223)
https://github.com/python/cpython/commit/bde3765a3fd21e2ecf595a57998b285e3045f744


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >