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

2022-02-08 Thread Eryk Sun


Eryk Sun  added the comment:

The venv launcher can quote the executable path either always or only when it 
contains spaces. The following is a suggestion for implementing the latter.

Before allocating `executable`, use memchr() (include ) to search the 
UTF-8 source for a space. If found, increment the character count by two. After 
allocating `executable`, add the initial quote character, and increment the 
pointer.

BOOL add_quotes = FALSE;
if (memchr(start, ' ', (size_t)len) != NULL) {
add_quotes = TRUE;
cch += 2;
}

executable = (wchar_t *)malloc(cch * sizeof(wchar_t));
if (executable == NULL) {
error(RC_NO_MEMORY, L"A memory allocation failed");
}

if (add_quotes) {
*executable++ = L'\"';
}

Later, after checking the existence via GetFileAttributesW(), add the trailing 
quote and null, and decrement the pointer:

if (GetFileAttributesW(executable) == INVALID_FILE_ATTRIBUTES) {
error(RC_NO_PYTHON, L"No Python at '%ls'", executable);
}

if (add_quotes) {
size_t n = wcslen(executable);
executable[n] = L'\"';
executable[n + 1] = L'\0';
executable--;
}

--

___
Python tracker 

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



[issue46688] Add sys.is_interned

2022-02-08 Thread Inada Naoki


Inada Naoki  added the comment:

Thank you, I can not find it because it is too old.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Add sys.isinterned()

___
Python tracker 

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



[issue46688] Add sys.is_interned

2022-02-08 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

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

--
nosy: +xtreak

___
Python tracker 

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



[issue46688] Add sys.is_interned

2022-02-08 Thread Inada Naoki


Inada Naoki  added the comment:

I thought sys.is_interned() is needed to implement bpo-46430, but GH-30683 
looks nice to me.
I will close this issue after GH-30683 is merged.

--

___
Python tracker 

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



[issue46684] Expose frozenset._hash classmethod

2022-02-08 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



[issue46688] Add sys.is_interned

2022-02-08 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue46688] Add sys.is_interned

2022-02-08 Thread Inada Naoki


New submission from Inada Naoki :

deepfreeze.py needs to know the unicode object is interned.

Ref: https://bugs.python.org/issue46430

--
components: Interpreter Core
messages: 412890
nosy: methane
priority: normal
severity: normal
status: open
title: Add sys.is_interned
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



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

2022-02-08 Thread Eryk Sun


Eryk Sun  added the comment:

I checked the source code in PC/launcher.c process(). It turns out that 
`executable` is not getting quoted in the venv launcher case.

CreateProcessW() tries to get around this. If the command isn't quoted, it has 
a loop that consumes up to a space (or tab) and checks for an existing file 
(not a directory). If it finds a file, it rewrites the command line to quote 
the path of the file.

My test happened to work. But it's simple enough to create an example that 
fails. For example, as an elevated admin, create a file named "C:\Program". Now 
the venv launcher won't be able to execute a base interpreter that's installed 
in "C:\Program Files":

C:\Temp>echo >C:\Program

C:\Temp>"C:\Program Files\Python310\python.exe" -m venv env
Error: Command '['C:\\Temp\\env\\Scripts\\python.exe', '-Im', 
'ensurepip', '--upgrade', '--default-pip']' returned non-zero 
exit status 101.

--
priority: normal -> critical
stage:  -> needs patch
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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

That's a question better suited to a forum such as the Users category of 
discuss.python.org, the python-l...@python.org mailing list, or StackOverflow, 
not a bug tracker issue.

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

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


German Salazar  added the comment:

So, help me understand, please. 


if I use "--enable-shared":
the build produces a rather small python executable; but, 
the build produces a dynamic library, too
and the path to the dynamic library must be included into LD_LIBRARY_PATH for 
the python executable to work correctly.

if I do NOT use "--enable-shared"
the build produces a larger python executable; and,
it does not produce a dynamic library, but
it produces an static library.
Does this mean that I do not have to worry about setting up LD_LIBRARY_PATH?

In the non-shared, static case, I thought the static library would be inside 
the executable, but, funny enough, I noticed that the python executable is 
smaller than the static library, so...I am confused. 

I would like to have 3.6, next to 3.7 and 3.8 with minimal setup, thus the 
static route.

Please advise.

--
components: +Installation
resolution: not a bug -> 
status: closed -> open
type:  -> behavior

___
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-08 Thread Eric Snow


Eric Snow  added the comment:


New changeset 77bab59c8a1f04922bb975cc4f11e5323d1d379d by Eric Snow in branch 
'main':
bpo-36876: Update the c-analyzer whitelist. (gh-31225)
https://github.com/python/cpython/commit/77bab59c8a1f04922bb975cc4f11e5323d1d379d


--

___
Python tracker 

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



[issue46613] Add PyType_GetModuleByDef to the public & limited API

2022-02-08 Thread Hai Shi


Change by Hai Shi :


--
nosy: +shihai1991

___
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-08 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +29396
pull_request: https://github.com/python/cpython/pull/31225

___
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-08 Thread Kesh Ikuma


Kesh Ikuma  added the comment:

@eryksun - I knew the reproducibility is the issue with this bug. On the same 
PC I've been having a problem with, I created another dummy account with a 
space in its username, and it worked flawlessly... So, it's something I've done 
to my account which triggered this behavior. 

Is there anything that I can try and report on my machine? I'd be happy to do so

--

___
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-08 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to use PyTuple_GET_ITEM(), but PySequence_Fast_ITEMS() is more 
effecient. It's hard to beat an array in C.

--

___
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-08 Thread Eryk Sun


Eryk Sun  added the comment:

run_child() expects `cmdline` to be correctly quoted, and normally it is.

I can't reproduce this problem with Python 3.10.2. I created a user account 
with a space in the account name, logged on, and installed 3.10.2 for the 
current user, with the option enabled to add Python to PATH. Next I opened a 
command prompt in the user profile directory and created a virtual environment 
via `python.exe -m venv .venv`. Running ".venv\Scripts\python.exe -X utf8" 
worked. The command line used by the venv "python.exe" launcher was properly 
quoted and thus properly parsed in the original list of command-line arguments, 
sys.orig_argv.

--
nosy: +eryksun

___
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-08 Thread hydroflask


hydroflask  added the comment:

I don't have github so I can't comment there but just as a nitpick, alloca() 
never returns NULL, so you don't have to check that. I know that is 
inconsistent with its use in callproc.c so for consistency's sake the NULL 
check should stay but I would remove both checks in a future change.

More importantly you can completely avoid the args_stack variable since 
alloca() has the same end affect. I would also add an assert that the number of 
args is <= CTYPES_MAX_ARGCOUNT, that should be the case since GH 31188

--

___
Python tracker 

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



[issue46687] Update pyexpat for CVE-2021-45960

2022-02-08 Thread Ned Deily


Ned Deily  added the comment:

Duplicate of Issue46400 ?

--
nosy: +ned.deily

___
Python tracker 

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



[issue46687] Update pyexpat for CVE-2021-45960

2022-02-08 Thread Steve Dower


New submission from Steve Dower :

libexpat recently fixed a security issue relating to some arithmetic: 
https://github.com/libexpat/libexpat/pull/534

I assume we should take this fix, either by updating our entire bundled copy or 
just backporting the patch.

--
components: XML
messages: 412880
nosy: steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: Update pyexpat for CVE-2021-45960
type: security
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



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

2022-02-08 Thread Dong-hee Na


Dong-hee Na  added the comment:

And it even better from performance view

--

___
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-08 Thread Dong-hee Na


Dong-hee Na  added the comment:

@hydroflask

Sound reasonable, I submitted a new patch to use alloca which is already used 
in _ctypes module.

--

___
Python tracker 

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



[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Joshua Bronson


Joshua Bronson  added the comment:

Thanks for the explanation, Raymond.

Regarding:

> Lastly, pure python hashable sets based on the ABC are not common

This would have implications for other use cases though, that are perhaps more 
common.

See, for example, the following code: 
https://github.com/jab/bidict/blob/ae9d06/bidict/_frozenbidict.py#L36-L38

This example demonstrates an implementation of a hashable, immutable Mapping 
type, whose __hash__ implementation returns 
collections.abc.ItemsView(self)._hash(). Since there are several other 
libraries I know of that implement hashable/immutable mapping types as well, I 
thought this might be beneficial enough to users to warrant consideration.

--

___
Python tracker 

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



[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-08 Thread Éric Araujo

Change by Éric Araujo :


--
versions:  -Python 3.10, 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



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

2022-02-08 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +29395
pull_request: https://github.com/python/cpython/pull/31224

___
Python tracker 

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



[issue46614] Add option to output UTC datetimes as "Z" in `.isoformat()`

2022-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

Would it be horrible to have the timezone instance control this?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-08 Thread Éric Araujo

Éric Araujo  added the comment:

The same problem exists for any attribute that has the same name as a builtin, 
see for example https://docs.python.org/3/library/sys.html#sys.float_info

--

___
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-08 Thread Kesh Ikuma


New submission from Kesh Ikuma :

After months of proper operation, my per-user Python install started to error 
out when I attempt `python -m venv .venv` with 

"Error: Command '['C:\\Users\\kesh\\test\\.venv\\Scripts\\python.exe', '-Im', 
'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 101."

Following the StackOverflow solution, I reinstalled Python for all users and it 
was working OK. I recently looked into it deeper and found the root issue in 
the function PC/launcher.c/run_child(). The path to the 
"...\Python\Python310\python.exe" contains a space, and the CreateProcessW() 
call on Line 811 is passing the path without quoting the path, causing the 
process creation to fail.

I fixed my issue by using the Windows short path convention on my path env. 
variable, but there must be a more permanent fix possible.

Here is the link to my question and self-answering to the problem:

https://stackoverflow.com/questions/71039131/troubleshooting-the-windows-venv-error-101

--
components: Windows
messages: 412874
nosy: hokiedsp, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [venv / PC/launcher] issue with a space in the installed python path
type: behavior
versions: Python 3.10, 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



[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Why not expose the C implementation via a frozenset._hash()
> classmethod, and change Set._hash() to merely call that?

The frozenset.__hash__ method is tightly bound to the internals of real sets to 
take advantage of the hash values already being known for real sets.  So we 
can't just expose it to ABC sets.

Also, the ABC sets need to be kept in sync with an __eq__ method, so users 
really need to see what Set._hash is actually doing.

Lastly, pure python hashable sets based on the ABC are not common, so it 
doesn't warrant a C fast path.  If C fast paths were offered, the union, 
intersection, and difference methods would more important targets.

So, thanks for the suggestion but it isn't as straight-forward as exposing 
existing code and it might make it harder for implementer to stay synced with 
an __eq__ method.

Tangential thought:  If you do implement __hash__ with Set._hash, consider 
using a cached_property decorator.

--
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
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



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

2022-02-08 Thread hydroflask


hydroflask  added the comment:

Two things, one is a nit pick the other is more serious. I think vstinner 
mentioned this in his review of your patch but on this line:

https://github.com/python/cpython/commit/b5527688aae11d0b5af58176267a9943576e71e5#diff-706e65ee28911740bf638707e19578b8182e57c6a8a9a4a91105d825f95a139dR180

Instead of using PySequence_Fast_ITEMS(), you can just use PyTuple_GET_ITEM() 
since you know the converters are a tuple. In terms of runtime efficiency it 
doesn't change anything but is consistent with this line: 
https://github.com/python/cpython/commit/b5527688aae11d0b5af58176267a9943576e71e5#diff-706e65ee28911740bf638707e19578b8182e57c6a8a9a4a91105d825f95a139dR157

Though on second thought I think PySequence_Fast_ITEMS() is probably a better 
API overall in terms of efficiency if PyTuple_GET_ITEM() would eventually 
become a real function call given the long term push toward a stable API.

The other issue is more serious, you are always allocating an array of 
CTYPES_MAX_ARGCOUNT pointers on the stack on every C callback. This could cause 
stack overflows in situations where a relatively deep set of callbacks are 
invoked. This usage of CTYPES_MAX_ARGCOUNT differs its usage in callproc.c, 
where in that case `alloca()` is used to allocate the specific number of array 
entries on the stack. To avoid an unintended stack overflow I would use 
alloca() or if you don't like alloca() I would only allocate a relatively small 
constant number on the stack.

--

___
Python tracker 

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



[issue46678] Invalid cross device link in Lib/test/support/import_helper.py

2022-02-08 Thread Brett Cannon


Change by Brett Cannon :


--
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



[issue46678] Invalid cross device link in Lib/test/support/import_helper.py

2022-02-08 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset c2735b75afd530631efde4ddd3cb24bbdc285559 by Miss Islington (bot) 
in branch '3.10':
bpo-46678: Fix Invalid cross device link in Lib/test/support/import_helper.py 
(GH-31204) (GH-31207)
https://github.com/python/cpython/commit/c2735b75afd530631efde4ddd3cb24bbdc285559


--
nosy: +brett.cannon

___
Python tracker 

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



[issue46556] pathlib.Path.__enter__() should emit DeprecationWarning

2022-02-08 Thread Brett Cannon


Change by Brett Cannon :


--
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



[issue46556] pathlib.Path.__enter__() should emit DeprecationWarning

2022-02-08 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset 06e1701ad3956352bc0f42b8f51c2f8cc85bf378 by Barney Gale in branch 
'main':
bpo-46556: emit `DeprecationWarning` from `pathlib.Path.__enter__()` (GH-30971)
https://github.com/python/cpython/commit/06e1701ad3956352bc0f42b8f51c2f8cc85bf378


--
nosy: +brett.cannon

___
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-08 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
pull_requests: +29394
pull_request: https://github.com/python/cpython/pull/31223

___
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-08 Thread Gregory Beauregard


Gregory Beauregard  added the comment:

I have made a thread on typing-sig to discuss this: 
https://mail.python.org/archives/list/typing-...@python.org/thread/WZ4BCFO4VZ7U4CZ4FSDQNFAKPG2KOGCL/

--

___
Python tracker 

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



[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-08 Thread Eric Snow


Eric Snow  added the comment:


New changeset 81c72044a181dbbfbf689d7a977d0d99090f26a8 by Eric Snow in branch 
'main':
bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized 
global objects. (gh-30928)
https://github.com/python/cpython/commit/81c72044a181dbbfbf689d7a977d0d99090f26a8


--

___
Python tracker 

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



[issue46657] Add mimalloc memory allocator

2022-02-08 Thread Christian Heimes


Christian Heimes  added the comment:

I re-ran the benchmark of d6f5f010b586:

| Benchmark   | 2022-02-08_11-54-master-69e10976b2e7 | 
2022-02-08_11-57-master-d6f5f010b586 |
|-|::|::|
| pickle_pure_python  | 312 us   | 281 us: 
1.11x faster |
| unpickle_pure_python| 238 us   | 216 us: 
1.10x faster |
| pyflate | 380 ms   | 349 ms: 
1.09x faster |
| hexiom  | 6.04 ms  | 5.55 ms: 
1.09x faster|
| logging_silent  | 97.5 ns  | 89.8 ns: 
1.09x faster|
| float   | 63.1 ms  | 59.3 ms: 
1.07x faster|
| html5lib| 62.8 ms  | 59.1 ms: 
1.06x faster|
| crypto_pyaes| 70.1 ms  | 66.1 ms: 
1.06x faster|
| json_loads  | 20.6 us  | 19.4 us: 
1.06x faster|
| tornado_http| 90.3 ms  | 86.1 ms: 
1.05x faster|
| mako| 8.85 ms  | 8.45 ms: 
1.05x faster|
| richards| 43.0 ms  | 41.1 ms: 
1.05x faster|
| xml_etree_parse | 126 ms   | 120 ms: 
1.05x faster |
| logging_format  | 5.47 us  | 5.25 us: 
1.04x faster|
| sympy_integrate | 17.2 ms  | 16.5 ms: 
1.04x faster|
| sympy_str   | 260 ms   | 251 ms: 
1.04x faster |
| fannkuch| 325 ms   | 314 ms: 
1.04x faster |
| regex_v8| 21.1 ms  | 20.4 ms: 
1.04x faster|
| sympy_expand| 441 ms   | 425 ms: 
1.04x faster |
| regex_compile   | 121 ms   | 117 ms: 
1.03x faster |
| sympy_sum   | 138 ms   | 134 ms: 
1.03x faster |
| scimark_lu  | 106 ms   | 103 ms: 
1.03x faster |
| go  | 128 ms   | 125 ms: 
1.03x faster |
| pathlib | 14.1 ms  | 13.7 ms: 
1.02x faster|
| scimark_monte_carlo | 58.8 ms  | 57.9 ms: 
1.02x faster|
| nqueens | 70.9 ms  | 69.9 ms: 
1.02x faster|
| pidigits| 155 ms   | 153 ms: 
1.01x faster |
| pickle  | 9.34 us  | 9.22 us: 
1.01x faster|
| raytrace| 278 ms   | 275 ms: 
1.01x faster |
| 2to3| 216 ms   | 213 ms: 
1.01x faster |
| deltablue   | 3.60 ms  | 3.56 ms: 
1.01x faster|
| logging_simple  | 4.84 us  | 4.78 us: 
1.01x faster|
| xml_etree_iterparse | 82.5 ms  | 81.7 ms: 
1.01x faster|
| regex_dna   | 164 ms   | 162 ms: 
1.01x faster |
| unpack_sequence | 32.7 ns  | 32.4 ns: 
1.01x faster|
| telco   | 5.53 ms  | 5.48 ms: 
1.01x faster|
| python_startup  | 5.56 ms  | 5.58 ms: 
1.00x slower|
| xml_etree_generate  | 71.2 ms  | 71.6 ms: 
1.01x slower|
| unpickle_list   | 4.08 us  | 4.12 us: 
1.01x slower|
| chameleon   | 6.07 ms  | 6.14 ms: 
1.01x slower|
| chaos   | 64.6 ms  | 65.3 ms: 
1.01x slower|
| json_dumps  | 9.61 ms  | 9.75 ms: 
1.01x slower|
| xml_etree_process   | 49.9 ms  | 50.7 ms: 
1.01x slower|
| meteor_contest  | 80.7 ms  | 82.0 ms: 
1.02x slower   

[issue45713] gcc warning when compiling Modules/expat/xmltok_ns.c

2022-02-08 Thread Cyril Jouve


Change by Cyril Jouve :


--
keywords: +patch
nosy: +Cyril Jouve
nosy_count: 2.0 -> 3.0
pull_requests: +29393
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31022

___
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-08 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks for catching these details! Please send a PR.

--

___
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-08 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
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-08 Thread Nikita Sobolev


New submission from Nikita Sobolev :

New features (like `Self` type and `Never` type), in my opinion, require some 
extra testing.

Things that were not covered:
- Inheritance from `Self`, only `type(Self)` is covered: 
https://github.com/python/cpython/blob/c018d3037b5b62e6d48d5985d1a37b91762fbffb/Lib/test/test_typing.py#L193-L196
- Equality and non-equality for `Self` and `Never`. We should be sure that 
`NoReturn` is not equal to `Never`, but they are equal to themselfs
- `get_type_hints` with `Never`
- `get_origin` with `Self` and `Never` types, it should return `None` for both 
cases
- (not exactly related) I've also noticed that this line is not covered at all: 
https://github.com/python/cpython/blob/c018d3037b5b62e6d48d5985d1a37b91762fbffb/Lib/typing.py#L725

Maybe there are some other cases? 

I will send a PR :)

--
components: Tests
messages: 412865
nosy: AlexWaygood, Jelle Zijlstra, gvanrossum, kj, sobolevn
priority: normal
severity: normal
status: open
title: Add additional tests for new features in `typing.py`
type: behavior
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



[issue46656] Compile fails if Py_NO_NAN is defined

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

Requiring IEEE 754 support is being discussed on python-dev: 
https://mail.python.org/archives/list/python-...@python.org/thread/J5FSP6J4EITPY5C2UJI7HSL2GQCTCUWN/

--

___
Python tracker 

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



[issue45490] [C API] PEP 670: Convert macros to functions in the Python C API

2022-02-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29391
pull_request: https://github.com/python/cpython/pull/31221

___
Python tracker 

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



[issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type

2022-02-08 Thread Georg Brandl


Change by Georg Brandl :


--
nosy:  -georg.brandl

___
Python tracker 

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



[issue46159] Segfault when using trace functions in 3.11a3

2022-02-08 Thread Cyril Jouve


Cyril Jouve  added the comment:

this looks related to https://github.com/nedbat/coveragepy/issues/1294 / 
https://github.com/nedbat/coveragepy/issues/1316 related to binary 
incompatibility in coverage (6.2) binary wheel built with 3.11alpha2 and 
running on 3.11alpha3 or later.

Latest release of coverage (6.3) do not ship binary wheel for python 3.11 
anymore, so it's installed and built with your current python.

--
nosy: +Cyril Jouve

___
Python tracker 

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



[issue12029] [doc] clarify that except does not match virtual subclasses of the specified exception type

2022-02-08 Thread Irit Katriel


Change by Irit Katriel :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
title: Allow catching virtual subclasses in except clauses -> [doc] clarify 
that except does not match virtual subclasses of the specified exception type
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue45952] Tools/c-analyzer is out-of-date.

2022-02-08 Thread Eric Snow


Eric Snow  added the comment:


New changeset c018d3037b5b62e6d48d5985d1a37b91762fbffb by Eric Snow in branch 
'main':
bpo-45952: Get the C analyzer tool working again. (gh-31220)
https://github.com/python/cpython/commit/c018d3037b5b62e6d48d5985d1a37b91762fbffb


--

___
Python tracker 

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



[issue45490] [C API] PEP 670: Convert macros to functions in the Python C API

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

I will use this issue to track changes related to PEP 670.

--
title: [meta][C API] Avoid C macro pitfalls and usage of static inline 
functions -> [C API]  PEP 670: Convert macros to functions in the Python C API

___
Python tracker 

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



[issue46475] typing.Never and typing.assert_never

2022-02-08 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
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



[issue45952] Tools/c-analyzer is out-of-date.

2022-02-08 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +29390
pull_request: https://github.com/python/cpython/pull/31220

___
Python tracker 

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



[issue46475] typing.Never and typing.assert_never

2022-02-08 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 243436f3779c1e7bed1fd4b23d5a8ec5eff40699 by Jelle Zijlstra in 
branch 'main':
bpo-46475: Add typing.Never and typing.assert_never (GH-30842)
https://github.com/python/cpython/commit/243436f3779c1e7bed1fd4b23d5a8ec5eff40699


--

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue45952] Tools/c-analyzer is out-of-date.

2022-02-08 Thread Eric Snow


Eric Snow  added the comment:


New changeset 1e6214dbd6a980b47123229aefd60bb2c9341b53 by Eric Snow in branch 
'main':
bpo-45952: Get the C analyzer tool working again. (gh-31219)
https://github.com/python/cpython/commit/1e6214dbd6a980b47123229aefd60bb2c9341b53


--

___
Python tracker 

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



[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Joshua Bronson


New submission from Joshua Bronson :

collections.abc.Set provides a _hash() method that includes the following in 
its docstring:

"""
Note that we don't define __hash__: not all sets are hashable.
But if you define a hashable set type, its __hash__ should
call this function.
...
We match the algorithm used by the built-in frozenset type.
"""

Because Set._hash() is currently implemented in pure Python, users face having 
to make a potentially challenging decision between whether to trade off runtime 
efficiency vs. space efficiency:

>>> hash(frozenset(x))  # Should I use this?
>>> Set._hash(x)# Or this?

The former requires O(n) memory to create the frozenset, merely to throw it 
immediately away, but on the other hand gets to use frozenset's __hash__ 
implementation, which is implemented in C.

The latter requires only O(1) memory, but does not get the performance benefit 
of using the C implementation of this algorithm.

Why not expose the C implementation via a frozenset._hash() classmethod, and 
change Set._hash() to merely call that?

Then it would be much clearer that using Set._hash() is always the right answer.

--
messages: 412856
nosy: jab
priority: normal
severity: normal
status: open
title: Expose frozenset._hash classmethod

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


German Salazar  added the comment:

Pre-post-edit: you are right, just saw your answer as I was typing this one. 


Aaaa

./python --version

is not enough, I guess I need to properly setup PATH, LD_LIBRARY_PATH and 
possibly PKG_CONFIG_PATH.

Sorry for the bother, guys. All is good. My apologies and thank you very much 
for the super fast response, it prompted to question and double question what I 
was doing.

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

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

I confirmed by downloading a fresh copy of each, extracting, and looking at 
Include/patchlevel.h.  You could further check by downloading a 3.6.8 tarball 
and comparing it against the 3.6.15 tarball.

Is 3.6.8 the version you already have installed, and are you building with 
`./configure --enable-shared`?  If so, my best guess would be that your new 
`./python` binary is picking up the system `libpython3.6.so`.  Try 
`LD_LIBRARY_PATH=$(pwd) ./python --version`.

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

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


German Salazar  added the comment:

I hear you, but I continue to need 3.6 for a bit longer.
I am on Linux, Centos 7; building from sources in a sandbox, no installation 
conflict with any else...

How do you confirm that the tarball indeed contains that it says? 

I build it and then I do "./python --version" and I get 3.6.8, instead of 
3.6.15   

I also have 3.7, and 3.8 installs (I also need them) and working on installing 
3.9 and 3.10

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

___
Python tracker 

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



[issue45952] Tools/c-analyzer is out-of-date.

2022-02-08 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +29389
pull_request: https://github.com/python/cpython/pull/31219

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

Also note that 3.6 is now EOL, so an upgrade is highly recommended anyway :)

--

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

I've just confirmed that both tarballs (gzip and xz) on the official download 
page (https://www.python.org/downloads/release/python-3615/) contain 3.6.15.

Note that 3.6.8 was the last bugfix release that included Windows and macOS 
installers.  If you're on one of those platforms, you may need to go through 
some extra steps to replace an existing 3.6.8 install with 3.6.15, and at that 
point you would likely be better off upgrading to 3.10 (or at least 3.9, which 
is the oldest release that still has a current binary installer).

--
nosy: +eric.smith, zach.ware
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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


German Salazar  added the comment:

>From 
https://www.python.org/downloads/release/python-3615/

Downloaded the XZ one:
https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tar.xz

I am currently building the Gzipped one, let's see what it turns out.

--
nosy:  -eric.smith

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread Eric V. Smith


Eric V. Smith  added the comment:

Where did you get the tarball?

--
nosy: +eric.smith

___
Python tracker 

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



[issue44006] symbol documentation still exists

2022-02-08 Thread Julien Palard


Julien Palard  added the comment:

Oh, it's ~unrelated, but thanks for the heads up, I overlooked a Sentry error :D

It's related to: https://github.com/python/docsbuild-scripts/issues/122, let's 
track it there.

(The visible effects are the same: the full build, reponsible for deleting the 
file is failing, while the quick (html only, not removing files) build succeed, 
so the old HTML files are kept if PDF builds are failing...)

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


Change by German Salazar :


--
versions:  -Python 3.7

___
Python tracker 

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



[issue46683] Python 3.6.15 source tarball installs 3.6.8?

2022-02-08 Thread German Salazar


New submission from German Salazar :

wanted to install 3.6.15, but the source tarball installs 3.6.8

--
messages: 412849
nosy: salgerman
priority: normal
severity: normal
status: open
title: Python 3.6.15 source tarball installs 3.6.8?
versions: Python 3.7

___
Python tracker 

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



[issue46682] python 3.10 Py_Initialize/Py_Main std path no longer includes site-packages

2022-02-08 Thread Paul Jaggi


New submission from Paul Jaggi :

Have the following simple program:
#include 
#include 

using namespace std;

int main(int argc, char** argv) {
  wchar_t* args[argc];
  for(int i = 0; i < argc; ++i) {
args[i] = Py_DecodeLocale(argv[i], nullptr);
  }

  Py_Initialize();
  const int exit_code = Py_Main(argc, args);
  cout << "Exit code: " << exit_code << endl;
  cout << "press any key to exit" << endl;
  cin.get();
  return 0;
}

When you run this program and in the console:
import sys
sys.path

for Python versions between 3.7-3.9, you get the installed python site-packages 
by default.  For Python 3.10, you don't.  This happens on both windows and Mac. 
 Is this an intentional change?

--
components: C API
messages: 412848
nosy: pjaggi1
priority: normal
severity: normal
status: open
title: python 3.10 Py_Initialize/Py_Main std path no longer includes 
site-packages
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



[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

I created GH-31218 which basically restores Python 3.10 code but enhances the 
test.

--

___
Python tracker 

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29388
pull_request: https://github.com/python/cpython/pull/31218

___
Python tracker 

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



[issue28159] Deprecate isdst argument in email.utils.localtime

2022-02-08 Thread Alan WiIliams


Alan WiIliams  added the comment:

Hi, I'd like to work on this issue. Based on the discussion, the main thing to 
do here is to raise a deprecation warning when isdst is used?

--
nosy: +Alan.Williams

___
Python tracker 

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



[issue45490] [meta][C API] Avoid C macro pitfalls and usage of static inline functions

2022-02-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29387
pull_request: https://github.com/python/cpython/pull/31217

___
Python tracker 

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



[issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11

2022-02-08 Thread Zachary Ware


Zachary Ware  added the comment:

> Can issue be closed now?

I think so; if others disagree they can reopen it :)

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue44006] symbol documentation still exists

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue for binhex.

https://docs.python.org/dev/library/binhex.html is still there whereas 
https://github.com/python/cpython/blob/main/Doc/library/binxhex.rst is gone.

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-08 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 6.0 -> 7.0
pull_requests: +29386
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/31216

___
Python tracker 

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



[issue46681] gzip.compress does not forward compresslevel to zlib.compress

2022-02-08 Thread Ilya Leoshkevich


Change by Ilya Leoshkevich :


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

___
Python tracker 

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



[issue46681] gzip.compress does not forward compresslevel to zlib.compress

2022-02-08 Thread Ilya Leoshkevich

New submission from Ilya Leoshkevich :

Started with:

commit ea23e7820f02840368569db8082bd0ca4d59b62a
Author: Ruben Vorderman 
Date:   Thu Sep 2 17:02:59 2021 +0200

bpo-43613: Faster implementation of gzip.compress and gzip.decompress 
(GH-27941)

Co-authored-by: Łukasz Langa 

The fix is quite trivial:

--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -587,7 +587,8 @@ def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, 
mtime=None):
 header = _create_simple_gzip_header(compresslevel, mtime)
 trailer = struct.pack("

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

Eryk: I created GH-31214 which uses the user preferred locale if the current 
LC_TIME locale is "C" or "POSIX".

Moreover, it no longer gets the current locale when the class is created. If 
locale=locale is passed, just use the current LC_TIME (or the user preferred is 
the locale is "C" or "POSIX").

--

___
Python tracker 

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29384
pull_request: https://github.com/python/cpython/pull/31214

___
Python tracker 

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



[issue46680] file calls itself

2022-02-08 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

https://stackoverflow.com/ or https://discuss.python.org/c/users/ are better 
places for this question.

--
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



[issue46680] file calls itself

2022-02-08 Thread renzo


New submission from renzo :

good morning
I created a file called prova.py

inside I put 3 lines
import test
a = 2
print (a)

d questions
why does a file have to call itself .. is it intended?
  how come it prints the value of a twice and does not enter the loop?

--
components: Build
messages: 412840
nosy: lallo
priority: normal
severity: normal
status: open
title: file calls itself
versions: Python 3.8

___
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-08 Thread Dong-hee Na


Dong-hee Na  added the comment:

@hydroflask

All patches are merged!
Thanks for all your suggestions :)

--
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



[issue46282] return value of builtins is not clearly indicated

2022-02-08 Thread Irit Katriel


Irit Katriel  added the comment:

I should have said "redundant information" rather than "obvious". 

I consider it redundant to specify that the default behavior applies to some 
specific case. If I read redundant information I may pause to think why it was 
necessary to explicitly state it, and whether I am misunderstanding something.

(Let's not make my bad choice of word turn this into a discussion about "what 
is obvious". The issue will probably never be closed if we do that.)

--

___
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-08 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset b5527688aae11d0b5af58176267a9943576e71e5 by Dong-hee Na in branch 
'main':
bpo-46323: Use PyObject_Vectorcall while calling ctypes callback function 
(GH-31138)
https://github.com/python/cpython/commit/b5527688aae11d0b5af58176267a9943576e71e5


--

___
Python tracker 

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



[issue46282] return value of builtins is not clearly indicated

2022-02-08 Thread Ned Batchelder


Ned Batchelder  added the comment:

What we're debating here is a micro-cosm of the broader "documentation 
philosophy" questions that I'm hoping the Documentation WG can iron out.  

What is "obvious"? Is it obvious that print returns None when file.write does 
not? Why does "exec" explicitly say it returns None, and no beginners were 
harmed, but having "print" say it returns None would be bad?

--

___
Python tracker 

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



[issue46657] Add mimalloc memory allocator

2022-02-08 Thread Christian Heimes


Christian Heimes  added the comment:

New benchmark:

| Benchmark   | 2022-02-08_11-54-master-69e10976b2e7 | 
2022-02-08_11-57-master-d6f5f010b586 |
|-|::|::|
| mako| 8.85 ms  | 7.83 ms: 
1.13x faster|
| hexiom  | 6.04 ms  | 5.54 ms: 
1.09x faster|
| spectral_norm   | 81.4 ms  | 75.2 ms: 
1.08x faster|
| pyflate | 380 ms   | 352 ms: 
1.08x faster |
| scimark_sparse_mat_mult | 4.05 ms  | 3.76 ms: 
1.08x faster|
| pickle_pure_python  | 312 us   | 290 us: 
1.07x faster |
| unpickle_pure_python| 238 us   | 222 us: 
1.07x faster |
| float   | 63.1 ms  | 59.5 ms: 
1.06x faster|
| tornado_http| 90.3 ms  | 86.0 ms: 
1.05x faster|
| html5lib| 62.8 ms  | 60.2 ms: 
1.04x faster|
| regex_compile   | 121 ms   | 116 ms: 
1.04x faster |
| scimark_lu  | 106 ms   | 102 ms: 
1.04x faster |
| nqueens | 70.9 ms  | 68.4 ms: 
1.04x faster|
| crypto_pyaes| 70.1 ms  | 67.8 ms: 
1.03x faster|
| logging_silent  | 97.5 ns  | 94.4 ns: 
1.03x faster|
| sympy_integrate | 17.2 ms  | 16.7 ms: 
1.03x faster|
| sympy_str   | 260 ms   | 252 ms: 
1.03x faster |
| sympy_expand| 441 ms   | 427 ms: 
1.03x faster |
| pathlib | 14.1 ms  | 13.7 ms: 
1.03x faster|
| regex_dna   | 164 ms   | 159 ms: 
1.03x faster |
| regex_v8| 21.1 ms  | 20.6 ms: 
1.02x faster|
| sympy_sum   | 138 ms   | 136 ms: 
1.02x faster |
| scimark_fft | 286 ms   | 281 ms: 
1.02x faster |
| pickle  | 9.34 us  | 9.19 us: 
1.02x faster|
| xml_etree_parse | 126 ms   | 124 ms: 
1.01x faster |
| richards| 43.0 ms  | 42.4 ms: 
1.01x faster|
| xml_etree_generate  | 71.2 ms  | 70.5 ms: 
1.01x faster|
| scimark_monte_carlo | 58.8 ms  | 58.3 ms: 
1.01x faster|
| deltablue   | 3.60 ms  | 3.58 ms: 
1.01x faster|
| chaos   | 64.6 ms  | 64.3 ms: 
1.01x faster|
| 2to3| 216 ms   | 215 ms: 
1.00x faster |
| pidigits| 155 ms   | 154 ms: 
1.00x faster |
| nbody   | 76.4 ms  | 77.0 ms: 
1.01x slower|
| python_startup_no_site  | 3.96 ms  | 3.99 ms: 
1.01x slower|
| xml_etree_iterparse | 82.5 ms  | 83.1 ms: 
1.01x slower|
| scimark_sor | 103 ms   | 104 ms: 
1.01x slower |
| unpickle| 11.3 us  | 11.4 us: 
1.01x slower|
| telco   | 5.53 ms  | 5.58 ms: 
1.01x slower|
| python_startup  | 5.56 ms  | 5.62 ms: 
1.01x slower|
| json_loads  | 20.6 us  | 20.8 us: 
1.01x slower|
| json_dumps  | 9.61 ms  | 9.77 ms: 
1.02x slower|
| dulwich_log | 60.9 ms  | 62.1 ms: 
1.02x slower|
| logging_format  | 5.47 us  | 5.62 us: 
1.03x slower|
| pickle_list | 3.06 us  | 3.15 us: 
1.03x slower|
| django_template 

[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2022-02-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2022-02-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This has been fixed by commit 69e10976b2e7682c6d57f4272932ebc19f8e8859:

Python 3.11.0a5+ (heads/main:69e10976b2, Feb  8 2022, 12:30:20) [Clang 12.0.0 
(clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import code
>>> code.interact()
Python 3.11.0a5+ (heads/main:69e10976b2, Feb  8 2022, 12:30:20) [Clang 12.0.0 
(clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> [
... def foo():
  File "", line 1
[
^
SyntaxError: '[' was never closed


Please, check that everything is in order and reopen the issue if we have 
missed something.

--

___
Python tracker 

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



[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-02-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am not backporting to 3.9 because the parser is different enough that 
introducing this would also introduce some unintended side effects.

--
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



[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-02-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5b58db75291cfbb9b6785c9845824b3e2da01c1c by Pablo Galindo Salgado 
in branch '3.10':
[3.10] bpo-46521: Fix codeop to use a new partial-input mode of the parser 
(GH-31010). (GH-31213)
https://github.com/python/cpython/commit/5b58db75291cfbb9b6785c9845824b3e2da01c1c


--

___
Python tracker 

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



[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-02-08 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +29383
pull_request: https://github.com/python/cpython/pull/31213

___
Python tracker 

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



[issue46521] codeop._maybe_compile passes code with error + triple quotes

2022-02-08 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 69e10976b2e7682c6d57f4272932ebc19f8e8859 by Pablo Galindo Salgado 
in branch 'main':
bpo-46521: Fix codeop to use a new partial-input mode of the parser (GH-31010)
https://github.com/python/cpython/commit/69e10976b2e7682c6d57f4272932ebc19f8e8859


--

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2022-02-08 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy:  -yan12125

___
Python tracker 

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



[issue46675] Allow more than 16 items in split-keys dicts and "virtual" object dicts.

2022-02-08 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 25db2b361beb865192a3424830ddcb0ae4b17318 by Mark Shannon in 
branch 'main':
bpo-46675: Allow object value arrays and split key dictionaries larger than 16 
(GH-31191)
https://github.com/python/cpython/commit/25db2b361beb865192a3424830ddcb0ae4b17318


--

___
Python tracker 

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



[issue20779] Add pathlib.chown method

2022-02-08 Thread Jaspar S.


Change by Jaspar S. :


--
pull_requests: +29382
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31212

___
Python tracker 

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread Eryk Sun


Eryk Sun  added the comment:

> Oh. Serhiy asked me to use LC_TIME rather than LC_CTYPE.

Since Locale*Calendar is documented as not being thread safe, __init__() could 
get the real default via setlocale(LC_TIME, "") when locale=None and the 
current LC_TIME is "C". Restore it back to "C" after getting the default. That 
should usually match the behavior from previous versions that called 
getdefaultlocale(). In cases where it differs, it's fixing a bug because the 
default LC_TIME is the correct default.

--

___
Python tracker 

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



[issue46662] Lib/sqlite3/dbapi2.py: convert_timestamp function failed to correctly parse timestamp

2022-02-08 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +lemburg

___
Python tracker 

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



[issue46662] Lib/sqlite3/dbapi2.py: convert_timestamp function failed to correctly parse timestamp

2022-02-08 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

The sqlite3 timestamp converter is buggy, as already noted in the docs[^1]. 
Adding timezone support is out of the question[^2][^3][^4][^5], but fixing it 
to be able to discard any attached timezone info _may_ be ok; at first sight, I 
don't see how this could break existing applications (like, for example adding 
time zone support could do). I need to think it through. In the meanwhile, I 
suggest taking a look at the linked issues.


[^1]: 
https://docs.python.org/3/library/sqlite3.html#default-adapters-and-converters
[^2]: bpo-19065
[^3]: bpo-26651
[^4]: bpo-45858
[^5]: 
https://discuss.python.org/t/fixing-sqlite-timestamp-converter-to-handle-utc-offsets/10985

--

___
Python tracker 

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

> I think calendar.Locale*Calendar should try the LC_CTYPE locale if LC_TIME is 
> "C", i.e. (None, None). Otherwise, it's introducing new default behavior. For 
> example, with LC_ALL set to "ru_RU.utf8": (...)

Oh. Serhiy asked me to use LC_TIME rather than LC_CTYPE.

See also my example in the PR:
https://github.com/python/cpython/pull/31166#issuecomment-1030887394

--

___
Python tracker 

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy: "getdefaultlocale() falls back to LANG and LANGUAGE. It allows also to 
specify a list of looked up environment variables. How could this use case be 
covered with getlocale()?"

What's your use case to use env vars rather than the current LC_CTYPE locale?

My concern is that when setlocale() is called, the current LC_CTYPE locale is 
inconsistent and you can get mojibake and others issues.

See for example:
https://bugs.python.org/issue43552#msg389069

Marc-Andre Lemburg wants to deprecate it:
https://bugs.python.org/issue43552#msg389076

--

___
Python tracker 

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



[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-08 Thread Eryk Sun

Eryk Sun  added the comment:

> getdefaultlocale() falls back to LANG and LANGUAGE.

_Py_SetLocaleFromEnv(LC_CTYPE) (e.g. setlocale(LC_CTYPE, "")) gets called at 
startup, except for the isolated configuration [1].

I think calendar.Locale*Calendar should try the LC_CTYPE locale if LC_TIME is 
"C", i.e. (None, None). Otherwise, it's introducing new default behavior. For 
example, with LC_ALL set to "ru_RU.utf8":

3.8:

>>> locale.getlocale(locale.LC_TIME)
(None, None)
>>> locale.getlocale(locale.LC_CTYPE)
('ru_RU', 'UTF-8')
>>> cal = calendar.LocaleTextCalendar()
>>> cal.formatweekday(0, 15)
'  Понедельник  '

3.11.0a5+:

>>> locale.getlocale(locale.LC_TIME)
(None, None)
>>> locale.getlocale(locale.LC_CTYPE)
('ru_RU', 'UTF-8')
>>> cal = calendar.LocaleTextCalendar()
>>> cal.formatweekday(0, 15)
' Monday'
>>> locale.setlocale(locale.LC_TIME, '')
'ru_RU.utf8'
>>> cal = calendar.LocaleTextCalendar()
>>> cal.formatweekday(0, 15)
'  Понедельник  '

---

[1] https://docs.python.org/3/c-api/init_config.html?#isolated-configuration

--
nosy: +eryksun

___
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-08 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29381
pull_request: https://github.com/python/cpython/pull/31211

___
Python tracker 

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



  1   2   >