[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-21 Thread Nikita Sobolev
Change by Nikita Sobolev : -- components: +Tests versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 ___ Python tracker ___

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-09-21 Thread Petr Viktorin
Petr Viktorin added the comment: Subinterpreters are not the only reason to do this (and they're not *my* reason to do it). Adding a way to create PyStructSequence heap will help users of the stable ABI, where reduced performance is a known tradeoff (see

[issue45254] HAS_SHMEM detection logic is duplicated in implementation and tests

2021-09-21 Thread Nikita Sobolev
New submission from Nikita Sobolev : `HAS_SHMEM` is defined in `multiprocessing.managers` module https://github.com/python/cpython/blob/0bfa1106acfcddc03590e1f5d6789dbad3affe70/Lib/multiprocessing/managers.py#L35-L40 Later the same logic is duplicated in `_test_multiprocessing`:

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-21 Thread neonene
neonene added the comment: I built 3.10rc2 PGO with PR28475 applied, and posted the inliner's log. In the log, the 4-callees mentioned above are now inlined, which were "hard reject"ed before. As for the performance, a few reporters may be needed, but it's not necessary for them to care

[issue45253] mimetypes cannot detect mime of mka files

2021-09-21 Thread Manuj Chandra
New submission from Manuj Chandra : The mimetypes library cannot detect mime of mka files. It returns None instead of audio. mp3 and mkv are working. Only mka is not working. -- components: Library (Lib) files: Screenshot from 2021-09-21 13-10-33.png messages: 402290 nosy:

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-21 Thread Ken Jin
Ken Jin added the comment: Like what Ma Lin and neonene have mentioned above, PR28475 recovered half of the lost performance. It's unfortunately still 4% slower than 3.10a7. >pyperf compare_to 310a7.json 310rc2.json 310rc2patched.json Geometric mean (versus 3.10a7) == 310rc2:

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: Then what about removing it from the list.sort() documentation too? Note that maintainers of other PEPs insist that this is a known fact and base their code on that: https://github.com/python/peps/pull/2077 --

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: I would recommend the wording in the "Sorting HOW TO" from: The sort routines are guaranteed to use __lt__() when making comparisons between two objects. to: The sort routines happen to use __lt__() when making comparisons between two

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Original: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 1))' 'sum(d)' 500 loops, best of 5: 712 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 1))' 'sum(d)' 2000 loops, best of 5: 149 usec per loop $ ./python -m timeit -s

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you. Could you please test PGO builds? -- ___ Python tracker ___ ___ Python-bugs-list

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-21 Thread neonene
neonene added the comment: To be fair, the slowdowns between PR25244 and b1 seems to be an accumulation of "1.00x slower" of every commit. I don't know after b1. -- ___ Python tracker

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-21 Thread Mark Shannon
Mark Shannon added the comment: The only other change of any obvious significance to _PyEval_EvalFrameDefault since 3.10a7 are the changes to MATCH_MAPPING and MATCH_SEQUENCE and those make _PyEval_EvalFrameDefault smaller. We may need to look elsewhere for the remaining ~4% performance.

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Hmm, thanks for insisting, Serhiy. I was accidentally using a debug build this time. I'll make a PGO build and rerun the microbenchmarks. -- ___ Python tracker

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Old, with PGO: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 1))' 'sum(d)' 1000 loops, best of 5: 340 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 1))' 'sum(d)' 2000 loops, best of 5: 114 usec per loop $ ./python -m

[issue44958] [sqlite3] only reset statements when needed

2021-09-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 050d1035957379d70e8601e6f5636637716a264b by Erlend Egeberg Aasland in branch 'main': bpo-44958: Only reset `sqlite3` statements when needed (GH-27844) https://github.com/python/cpython/commit/050d1035957379d70e8601e6f5636637716a264b

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2021-09-21 Thread Nikita Sobolev
Nikita Sobolev added the comment: Happened to me today: https://dev.azure.com/Python/cpython/_build/results?buildId=88208=logs=c83831cd-3752-5cc7-2f01-8276919eb334=5a421c4a-0933-53d5-26b9-04b36ad165eb ``` test_sendfile_close_peer_in_the_middle_of_receiving

[issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are

2021-09-21 Thread Sebastian Rittau
Sebastian Rittau added the comment: One thing I would strongly suggest for consistent terminology: Make "iterator" mean an object that has both "__next()__" and "__iter()__". This is consistent with how an iterator has been described in the glossary for a long time, but also consistent with

[issue45256] Remove the usage of the cstack in Python to Python calls

2021-09-21 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : Removing the usage of the C stack in Python-to-Python calls will allow future optimizations in the eval loop to take place and can yield some speed ups given that we will be removing C function calls and preambles by inlining the callee in the same

[issue30349] Preparation for advanced set syntax in regular expressions

2021-09-21 Thread Philippe Ombredanne
Philippe Ombredanne added the comment: Sorry, my comment was at best nonsensical gibberish! I meant to say that this warning message should include the actual regex at fault; otherwise it is hard to fix when the regex in question comes from some data structure like a list; then the line

[issue45256] Remove the usage of the cstack in Python to Python calls

2021-09-21 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +26884 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28488 ___ Python tracker

[issue45176] Many regtest failures on Windows with non-ASCII account name

2021-09-21 Thread Eryk Sun
Eryk Sun added the comment: I see no problem with changing a test -- such as test_consistent_sys_path_for_direct_execution() -- to spawn the child interpreter with `-X utf8` when the I/O encoding itself is irrelevant to the test -- except for forcing a common Unicode encoding to ensure the

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset debd80403721b00423680328d6adf160a28fbff4 by scoder in branch 'main': bpo-24076: Inline single digit unpacking in the integer fastpath of sum() (GH-28469) https://github.com/python/cpython/commit/debd80403721b00423680328d6adf160a28fbff4

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What are microbenchmark results for PR 28469 in comparison with the baseline? -- ___ Python tracker ___

[issue30349] Preparation for advanced set syntax in regular expressions

2021-09-21 Thread Philippe Ombredanne
Philippe Ombredanne added the comment: FWIW, this warning is annoying because it is hard to fix in the case where the regex are source from data: the warning message does not include the regex at fault; it should otherwise the warning is noisy and ineffective IMHO. -- nosy:

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Stefan Behnel
Change by Stefan Behnel : -- Removed message: https://bugs.python.org/msg402301 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Original: $ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 1))' 'sum(d)' 500 loops, best of 5: 712 usec per loop $ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 1))' 'sum(d)' 2000 loops, best of 5: 149 usec per loop $ ./python -m timeit -s

[issue45176] Many regtest failures on Windows with non-ASCII account name

2021-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Not only sys.executable. Sources of non-ASCII paths: * sys.executable * __file__ of the stdlib or test modules * the current working directory * the temporary directory The last one is the most common in these failures. Tests fail when a non-ASCII path is

[issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't

2021-09-21 Thread Isaac Boates
New submission from Isaac Boates : I was just using the sqlite3 package and was very confused when trying to open an sqlite database from a relative path, because the only error provided was: File "/path/to/filepy", line 50, in __init__ self.connection = sqlite3.connect(path)

[issue42406] Importing multiprocessing breaks pickle.whichmodule

2021-09-21 Thread Roundup Robot
Change by Roundup Robot : -- nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +26885 pull_request: https://github.com/python/cpython/pull/28489 ___ Python tracker ___

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't

2021-09-21 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40951] csv skipinitialspace no longer working

2021-09-21 Thread Andrei Kulakov
Andrei Kulakov added the comment: Closing; if anyone finds a way to reproduce please add a comment or open a new issue. -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker

[issue44958] [sqlite3] only reset statements when needed

2021-09-21 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Now that pysqlite_statement_reset() is only used in cursor.c, I suggest to move it to cursor.c and make it a static function. -- ___ Python tracker

[issue45256] Remove the usage of the cstack in Python to Python calls

2021-09-21 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-21 Thread neonene
neonene added the comment: PR28475 PGO is 2% slower than the patch I pasted on msg401743. The function sizes are almost the same (+1:goto,+1:label), and there is no performance gap between release builds. I suspect the following. 1. PGO is too sensitive to a function size at near the limit.

[issue44958] [sqlite3] only reset statements when needed

2021-09-21 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26886 pull_request: https://github.com/python/cpython/pull/28490 ___ Python tracker ___

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you again Stefan. Now no doubts are left. BTW, pyperf gives more stable results. I use it if have any doubts (either the results of timeit are not stable or the difference is less than say 10%). -- ___

[issue45233] Allow split key dictionaries with values owned by other objects.

2021-09-21 Thread Mark Shannon
Mark Shannon added the comment: Experiments show that using `stride` just makes the code more complex, `dk_kind` is sufficient. We will still need ownership flags for split dicts, though. A single flag may suffice. -- ___ Python tracker

[issue44958] [sqlite3] only reset statements when needed

2021-09-21 Thread miss-islington
miss-islington added the comment: New changeset 3e3ff09058a71b92c32d1d7dc32470c0cf49300c by Erlend Egeberg Aasland in branch 'main': bpo-44958: Fix ref. leak introduced in GH-27844 (GH-28490) https://github.com/python/cpython/commit/3e3ff09058a71b92c32d1d7dc32470c0cf49300c -- nosy:

[issue45257] Compiling 3.8 branch on Windows attempts to use incompatible libffi version

2021-09-21 Thread William Proffitt
New submission from William Proffitt : Wasn't sure where to file this. I built Python 3.8.12 for Windows recently from the latest bugfix source release in the cpython repository. One tricky thing came up I wanted to write-up in case it matters to someone else. The version of libffi in the

[issue45176] Many regtest failures on Windows with non-ASCII account name

2021-09-21 Thread Steve Dower
Steve Dower added the comment: > I've already installed for all users, just not into the default "C:\Program > Files\", but instead "C:\Programs\Python\" Ah yes, that indeed rules out my first suspicion. > Fixing tests is not enough, because it is often an issue of scripts which > write

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Unfortunately commit debd80403721b00423680328d6adf160a28fbff4 introduced a reference leak: ❯ ./python -m test test_grammar -R : 0:00:00 load avg: 2.96 Run tests sequentially 0:00:00 load avg: 2.96 [1/1] test_grammar beginning 9 repetitions 123456789

[issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs)

2021-09-21 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +26887 pull_request: https://github.com/python/cpython/pull/28492 ___ Python tracker ___

[issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs)

2021-09-21 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45200] Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs)

2021-09-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset a356272362c15f2561872f3206baf5e9a0543997 by Pablo Galindo Salgado in branch 'main': bpo-45200: Ignore test_multiprocessing_* in ASAN build due to false positives (GH-28492)

[issue45257] Compiling 3.8 branch on Windows attempts to use incompatible libffi version

2021-09-21 Thread Steve Dower
Steve Dower added the comment: Yes, unfortunately the external build was not referencing a tag in those sources but a branch, so when the newer version was pushed they picked it up. We fixed the pin in https://github.com/python/cpython/commit/8c3a10e58b12608c3759fee684e7aa399facae2a You

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +26888 pull_request: https://github.com/python/cpython/pull/28493 ___ Python tracker ___

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Opened #28493 to fix the refleak -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Sorry, I meant PR 28493 -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue45226] Misleading error message when pathlib.Path.symlink_to() fails with permissions error

2021-09-21 Thread Maor Feldinger
Maor Feldinger added the comment: Oh I see what you mean, sorry about that, maybe the comperison to `os.symlink()` was wrong. It still feels wrong to me with since I am trying to make src symlink(point) to target and in the error message it looks like I am trying to do the other way

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +26889 pull_request: https://github.com/python/cpython/pull/28494 ___ Python tracker ___

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: I've seen the new PR for sorted(), thank you for looking into this. Would it make sense to change list.sort() in the same way? -- ___ Python tracker

[issue40503] PEP 615: Add zoneinfo module

2021-09-21 Thread Isuru Fernando
Change by Isuru Fernando : -- pull_requests: +26890 pull_request: https://github.com/python/cpython/pull/28495 ___ Python tracker ___

[issue40503] PEP 615: Add zoneinfo module

2021-09-21 Thread Isuru Fernando
Isuru Fernando added the comment: Thanks @steve.dower for the info. I've created https://github.com/python/cpython/pull/28495. Let me know if it needs to have a separate bpo issue. -- ___ Python tracker

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Thank you for looking into this. You're welcome :-) > Would it make sense to change list.sort() in the same way? I think not. This is a such a minor point and is a distractor. Most users would be better off focusing on the other text. --

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 9a0dcc5b2e04d9c51350107734f12a1cbc0284a7 by Raymond Hettinger in branch 'main': bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) https://github.com/python/cpython/commit/9a0dcc5b2e04d9c51350107734f12a1cbc0284a7

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26891 pull_request: https://github.com/python/cpython/pull/28496 ___ Python tracker

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread miss-islington
Change by miss-islington : -- pull_requests: +26892 pull_request: https://github.com/python/cpython/pull/28497 ___ Python tracker ___

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2021-09-21 Thread Łukasz Langa
Łukasz Langa added the comment: I'm not sure whether we should downright reject `__init__()` methods. Sadly, they aren't usable at the moment anyway, but they could. Hear me out. There seems to be a gap in the PEP 544 definition of protocols, i.e. whether `__init__` should be definable as

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-21 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 1c7e98dc258a0e7ccd2325a1aefc4aa2de51e1c5 by Pablo Galindo Salgado in branch 'main': bpo-24076: Fix reference in sum() introduced by GH-28469 (GH-28493) https://github.com/python/cpython/commit/1c7e98dc258a0e7ccd2325a1aefc4aa2de51e1c5

[issue45026] More compact range iterator

2021-09-21 Thread Łukasz Langa
Łukasz Langa added the comment: Looks like GH-28176 is faster across the board. One missing benchmark here is comparing `len()` speed as this was where the results will be reversed. It would be interesting to see to what extent. -- ___ Python

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-21 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +26893 pull_request: https://github.com/python/cpython/pull/28498 ___ Python tracker ___

[issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown

2021-09-21 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset f604cf1c377a7648e0686044e6e49900bfc9feef by Nikita Sobolev in branch 'main': bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing (GH-28377) https://github.com/python/cpython/commit/f604cf1c377a7648e0686044e6e49900bfc9feef

[issue45246] the sorted() documentation should refer to operator

2021-09-21 Thread miss-islington
miss-islington added the comment: New changeset aea92de9900ceb8d679a9324fc72621940b9c8a0 by Miss Islington (bot) in branch '3.9': bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) https://github.com/python/cpython/commit/aea92de9900ceb8d679a9324fc72621940b9c8a0

[issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown

2021-09-21 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26894 pull_request: https://github.com/python/cpython/pull/28499 ___ Python tracker

[issue45209] multiprocessing tests log: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown

2021-09-21 Thread miss-islington
Change by miss-islington : -- pull_requests: +26895 pull_request: https://github.com/python/cpython/pull/28500 ___ Python tracker ___

<    1   2