[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 

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



[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 
https://www.python.org/dev/peps/pep-0652/#stable-abi: "The Stable ABI trades 
performance for its stability").
More generally, this would need solving one of the remaining limitations of the 
limited API (PEPs 489, 630): type-specific data. If Hai Shi solves the problem, 
the solution will be useful even if PyStructSequence_FromModuleAndDesc turns 
out useless. 

Using the proposed new API in CPython's stdlib should be done much more 
deliberately, and yes, would need a PEP.

--

___
Python tracker 

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



[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`: 
https://github.com/python/cpython/blob/0bfa1106acfcddc03590e1f5d6789dbad3affe70/Lib/test/_test_multiprocessing.py#L52-L56

We can just use `multiprocessing.managers.HAS_SHMEM` instead.

I am going to send a PR with the fix.

--
messages: 402291
nosy: sobolevn
priority: normal
severity: normal
status: open
title: HAS_SHMEM detection logic is duplicated in implementation and tests
type: behavior

___
Python tracker 

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



[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 about noises in the apparent gap.

310rc2 x64 PGO   : 1.00
 + PR28475 build1 bench1 : 1.05x faster (slower  7, faster 43, nochange  8)
  bench2 : 1.05x faster (slower  2, faster 43, nochange 13)
   build2: 1.05x faster (slower  4, faster 45, nochange  9)

310rc2 x64 release   : 1.00
 + PR28475   : 1.01x faster (slower 14, faster 25, nochange 19)


Is Windows involved in the faster-cpython project? If so, the project should be 
provided with Windows machines for validation.

--
Added file: https://bugs.python.org/file50291/PR28475_inline.log

___
Python tracker 

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



[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: manujchandra
priority: normal
severity: normal
status: open
title: mimetypes cannot detect mime of mka files
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50292/Screenshot from 2021-09-21 
13-10-33.png

___
Python tracker 

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



[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: 1.09x slower
310rc2patched: 1.04x slower

Attached pyperf benchmark comparisons file.

--
Added file: https://bugs.python.org/file50293/PR28475_vs_310rc2_vs_310a7.txt

___
Python tracker 

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



[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

--

___
Python tracker 

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



[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 objects.

--

___
Python tracker 

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



[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 'd = list(range(2**29, 2**29 + 1))' 'sum(d)'
2000 loops, best of 5: 107 usec per loop
$ ./python -m timeit -s 'd = list(range(1))' 'sum(d)'
2000 loops, best of 5: 107 usec per loop

New:
stefan@flup:~/ablage/software/Python/python-git$ ./python -m timeit -s 'd = 
list(range(2**61, 2**61 + 1))' 'sum(d)'
500 loops, best of 5: 713 usec per loop
$ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 1))' 'sum(d)'
2000 loops, best of 5: 148 usec per loop
$ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 1))' 'sum(d)'
5000 loops, best of 5: 77.4 usec per loop
$ ./python -m timeit -s 'd = list(range(1))' 'sum(d)'
5000 loops, best of 5: 77.2 usec per loop

Seems to be 28% faster for the single digit case and exactly as fast as before 
with larger integers.
Note that these are not PGO builds.

--

___
Python tracker 

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



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

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



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

--

___
Python tracker 

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



[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 

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



[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 timeit -s 'd = list(range(2**29, 2**29 + 1))' 'sum(d)'
5000 loops, best of 5: 73.4 usec per loop
$ ./python -m timeit -s 'd = list(range(1))' 'sum(d)'
5000 loops, best of 5: 73.3 usec per loop
$ ./python -m timeit -s 'd = [0] * 1' 'sum(d)'
5000 loops, best of 5: 78.7 usec per loop


New, with PGO:
$ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 1))' 'sum(d)'
1000 loops, best of 5: 305 usec per loop
$ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 1))' 'sum(d)'
2000 loops, best of 5: 115 usec per loop
$ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 1))' 'sum(d)'
5000 loops, best of 5: 52.4 usec per loop
$ ./python -m timeit -s 'd = list(range(1))' 'sum(d)'
5000 loops, best of 5: 54 usec per loop
$ ./python -m timeit -s 'd = [0] * 1' 'sum(d)'
5000 loops, best of 5: 45.8 usec per loop

The results are a bit more mixed with PGO optimisation (I tried a couple of 
times), not sure why. Might just be normal fluctuation, bad benchmark value 
selection, or accidental PGO tuning, can't say. In any case, the 1-digit case 
(1, 2**29) is again about 28% faster and none of the other cases seems 
(visibly) slower.

I think this is a very clear net-win.

--

___
Python tracker 

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



[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


--

___
Python tracker 

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



[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 
(test.test_asyncio.test_sendfile.ProactorEventLoopTests) ... FAIL
test test_asyncio failed
test_sendfile_close_peer_in_the_middle_of_receiving 
(test.test_asyncio.test_sendfile.SelectEventLoopTests) ... ok

==
FAIL: test_sendfile_close_peer_in_the_middle_of_receiving 
(test.test_asyncio.test_sendfile.ProactorEventLoopTests)
--
Traceback (most recent call last):
  File "D:\a\1\s\lib\test\test_asyncio\test_sendfile.py", line 457, in 
test_sendfile_close_peer_in_the_middle_of_receiving
with self.assertRaises(ConnectionError):

AssertionError: ConnectionError not raised

--
Ran 2 tests in 0.087s

FAILED (failures=1)
0:08:56 load avg: 3.51 Re-running test_concurrent_futures in verbose mode 
(matching: test_cancel_futures_wait_false)
test_cancel_futures_wait_false 
(test.test_concurrent_futures.ThreadPoolShutdownTest) ... ok

--
Ran 1 test in 0.303s

OK
1 test failed again:
test_asyncio
```

--
nosy: +sobolevn

___
Python tracker 

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



[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 (abc.collections|typing).Iterator.

Either invent a different term for objects having "__next__()" (but not 
necessarily "__iter__()"), or use a description like "an iterator or any other 
object that has a __next__() method".

--
nosy: +srittau

___
Python tracker 

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



[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 eval loop as the caller.

--
messages: 402311
nosy: Mark.Shannon, pablogsal
priority: normal
severity: normal
status: open
title: Remove the usage of the cstack in Python to Python calls
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



[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 number where the warning occurs is 
not enough to fix the issue; the code needs to be instrumented first to catch 
warning which is rather heavy handed to handle a warning.

--

___
Python tracker 

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



[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 

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



[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 integrity of 
test data (i.e. no mojibake) and prevent encoding/decoding failures.

--

___
Python tracker 

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



[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


--

___
Python tracker 

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



[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 

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



[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: +pombredanne

___
Python tracker 

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



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 'd = list(range(2**29, 2**29 + 1))' 'sum(d)'
2000 loops, best of 5: 107 usec per loop
$ ./python -m timeit -s 'd = list(range(1))' 'sum(d)'
2000 loops, best of 5: 107 usec per loop

New:
$ ./python -m timeit -s 'd = list(range(2**61, 2**61 + 1))' 'sum(d)'
500 loops, best of 5: 713 usec per loop
$ ./python -m timeit -s 'd = list(range(2**30, 2**30 + 1))' 'sum(d)'
2000 loops, best of 5: 148 usec per loop
$ ./python -m timeit -s 'd = list(range(2**29, 2**29 + 1))' 'sum(d)'
5000 loops, best of 5: 77.4 usec per loop
$ ./python -m timeit -s 'd = list(range(1))' 'sum(d)'
5000 loops, best of 5: 77.2 usec per loop

Seems to be 28% faster for the single digit case and exactly as fast as before 
with larger integers.
Note that these are not PGO builds.

--

___
Python tracker 

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



[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 written to the stdout or a file with the 
default encoding (which differs from the filesystem encoding) and then read 
with implying:

* the ASCII encoding
* the UTF-8 encoding
* the filesystem encoding

Fixing tests is not enough, because it is often an issue of scripts which write 
paths to the stdout. This problem does not have simple and general solution.

--

___
Python tracker 

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



[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)
sqlite3.OperationalError: unable to open database file

It turns out I was just executing Python from the wrong location and therefore 
my relative path was broken. Not a big problem. But it was confusing because it 
only throws this generic OperationalError.

Could it instead throw a FileNotFoundError if the db simply doesn't exist at 
the specified path?

--
messages: 402309
nosy: iboates
priority: normal
severity: normal
status: open
title: sqlite3.connect() should check if the sqlite file exists and throw a 
FileNotFoundError if it doesn't
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



[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 

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



[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 

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



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

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



[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 

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



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.
2. PR28475 is not fully covered by 44 tests. (msg401346)

--

___
Python tracker 

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



[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 

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



[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%).

--

___
Python tracker 

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



[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 

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



[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: +miss-islington

___
Python tracker 

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



[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 cpython-bin-deps repository seems to be too new 
for Python 3.8.12 now. The script for fetching the external dependencies 
(PCBuild\get_externals.bat) on the 3.8 branch fetches whatever is newest on the 
libffi branch, and this led to it downloading files starting with "libffi-8" 
and the build complaining about being unable to locate "libffi-7". 

I managed to resolve this by manually replacing the fetched libffi in the 
externals directory with the one from this commit, the latest commit I could 
find where the filenames started with "libffi-7": 
https://github.com/python/cpython-bin-deps/commit/1cf06233e3ceb49dc0a73c55e04b1174b436b632

After that, I was able to successfully run "build.bat -e -p x64" in PCBuild and 
"build.bat -x64" in "Tools\msi\" and end up with a working build and a working 
installer.

(Side note that isn't that important for me but maybe worth mentioning while 
I'm here: the uninstaller on my newly minted installer didn't seem to work at 
all and I had to manually resort to deleting registry keys to overwrite my 
previous attempted install.)

--
components: Build, Installation, Windows, ctypes
messages: 402318
nosy: paul.moore, proffitt, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Compiling 3.8 branch on Windows attempts to use incompatible libffi 
version
type: compile error
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



[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 paths to the stdout.

Sure, but the ones currently failing here are ours, so we are the ones who need 
to fix them :) And they all seem to be in our test suite.

Fixing the tests doesn't make all the problems go away, just the specific ones 
we are responsible for on this issue.

--

___
Python tracker 

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



[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
.
test_grammar leaked [12, 12, 12, 12] references, sum=48
test_grammar failed (reference leak)

== Tests result: FAILURE ==

1 test failed:
test_grammar

Total duration: 1.1 sec
Tests result: FAILURE

debd80403721b00423680328d6adf160a28fbff4 is the first bad commit
commit debd80403721b00423680328d6adf160a28fbff4
Author: scoder 
Date:   Tue Sep 21 11:01:18 2021 +0200

bpo-24076: Inline single digit unpacking in the integer fastpath of sum() 
(GH-28469)

 .../Core and Builtins/2021-09-20-10-02-12.bpo-24076.ZFgFSj.rst |  1 +
 Python/bltinmodule.c   | 10 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 Misc/NEWS.d/next/Core and 
Builtins/2021-09-20-10-02-12.bpo-24076.ZFgFSj.rst

--
nosy: +pablogsal

___
Python tracker 

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



[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 

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



[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 

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



[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)
https://github.com/python/cpython/commit/a356272362c15f2561872f3206baf5e9a0543997


--

___
Python tracker 

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



[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 should only need the get_externals.bat change.

--

___
Python tracker 

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



[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 

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



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
around.

--

___
Python tracker 

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



[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 

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



[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 

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



[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 

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



[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 

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



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

--

___
Python tracker 

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



[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


--

___
Python tracker 

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



[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 

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



[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 

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



[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 

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



[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 part of a protocol. Currently this isn't 
specified and it looks like Mypy is ignoring `__init__` in Protocol definitions.

Consider this example: 
https://gist.github.com/ambv/0ed9c9ec5b8469878f47074bdcd37b0c

Mypy doesn't consider `__init__()` to be part of a protocol, even though it's 
an instance method like any other. It is valid (albeit weird) to call it again 
on an already initialized instance:

>>> class C:
...   def __init__(self) -> None:
... print('init!')
...
>>> c = C()
init!
>>> c.__init__()
init!
>>> c.__init__()
init!

In the linked gist example, Mypy currently ignores `__init__()` but doesn't 
ignore `get_ball()`, thus incorrectly judging BallContainer and 
TwoBallContainer to be equivalent.
In fact, it only rejects the third ifmain call with `object` because `object` 
lacks a `get_ball()` method.

So... would that be useful? Do we ever want to define protocols on the basis of 
how their initializers look like? My uninformed intuition is that this might be 
potentially useful, however I fail to come up with a realistic example here.

--
nosy: +lukasz.langa

___
Python tracker 

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



[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


--

___
Python tracker 

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



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

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



[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 

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



[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


--
nosy: +lukasz.langa

___
Python tracker 

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



[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


--

___
Python tracker 

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



[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 

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



[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 

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



<    1   2