[issue45003] Documentation wrote __div__ instead of __truediv__

2021-08-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 46970fdd8ddc18823519d1e1c57136f6bc2a8dac by Miss Islington (bot) 
in branch '3.9':
bpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951) 
(GH-27962)
https://github.com/python/cpython/commit/46970fdd8ddc18823519d1e1c57136f6bc2a8dac


--

___
Python tracker 

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



[issue45003] Documentation wrote __div__ instead of __truediv__

2021-08-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ea39933b4b76da35874be79f2384e24b38c37351 by Miss Islington (bot) 
in branch '3.10':
bpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951) 
(GH-27963)
https://github.com/python/cpython/commit/ea39933b4b76da35874be79f2384e24b38c37351


--

___
Python tracker 

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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> FTR, this is only a problem if you link with the Apple-supplied system 
> libsqlite3 [...]

Sure, but that should be relatively trivial to detect. AFAIK, the SQLite 
command line shell seems to be located at the same path every release, so I 
would guess that also applies for the library.

Alternatively, we could dump the compile options and grep for 
SQLITE_OMIT_LOAD_EXTENSION, but that implies locating the SQLite command line 
shell that corresponds to the library that we're using. Probably trickier, but 
would definitely be useful if/when we add support for the SQLite serialize API, 
RTree callbacks, etc.

--

___
Python tracker 

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



[issue45003] Documentation wrote __div__ instead of __truediv__

2021-08-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Thanks for merging the NEWS amendments, Pablo. We can close this issue after 
landing PR 27642.

--

___
Python tracker 

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



[issue45007] OpenSSL 1.1.1l is released

2021-08-26 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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

...or we can just leave it as it. Seems like these reports only pops up once in 
a while.

--

___
Python tracker 

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



[issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array

2021-08-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

> The rounding correction in _ss() looks mathematically incorrect to me [...]

I don't think it was intended as a rounding correction - I think it's just 
computing the variance (prior to the division by n or n-1) of the `(x - c)` 
terms using the standard "expectation of x^2 - (expectation of x)^2" formula:

  sum((x - c)**2 for x in data) - (sum(x - c for x in data)**2) / n

So I guess it *can* be thought of as a rounding correction, but what it's 
correcting for is an inaccurate value of "c"; it's not correcting for 
inaccuracies in the subtraction results. That is, if you were to add an 
artificial error into c at some point before computing "total" and "total2", 
that correction term should take you back to something approaching the true sum 
of squares of deviations.

So mathematically, I think it's correct, but not useful, because mathematically 
"total2" will be zero. Numerically, it's probably not helpful.

--

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asycio

2021-08-26 Thread mattip


New submission from mattip :

PyPy has no asyncio c-extension module _asyncio. I see stdlib test failures 
when running the tests in test/test_asyncio/*.py. If I disable _asyncio in 
Lib/asyncio/events.py (at the end of the file) I see similar failures in 
CPython3.8 on Ubuntu 20.04 in

test_buffered_proto.py test_buffered_proto_create_connection

test_sslproto.py test_create_connection_memory_leak, test_handshake_timeout, 
test_start_tls_client_buf_proto_1, 

Also this test depends on _CFuture
test_futures.py

--
components: asyncio
messages: 400322
nosy: asvetlov, mattip, yselivanov
priority: normal
severity: normal
status: open
title: tests fail when using pure-python instead of _asycio

___
Python tracker 

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



[issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array

2021-08-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

> what it's correcting for is an inaccurate value of "c" [...]

In more detail:

Suppose "m" is the true mean of the x in data, but all we have is an 
approximate mean "c" to work with. Write "e" for the error in that 
approximation, so that c = m + e. Then (using Python notation, but treating the 
expressions as exact mathematical expressions computed in the reals):

   sum((x-c)**2 for x in data)

== sum((x-m-e)**2 for x in data)

== sum((x - m)**2 for x in data) - 2 * sum((x - m)*e for x in data)
 + sum(e**2 for x in data)

== sum((x - m)**2 for x in data) - 2 * e * sum((x - m) for x in data)
 + sum(e**2 for x in data)

== sum((x - m)**2 for x in data) + sum(e**2 for x in data)
   (because sum((x - m) for x in data) is 0)

== sum((x - m)**2 for x in data) + n*e**2

So the error in our result arising from the error in computing m is that n*e**2 
term. And that's the term that's being subtracted here, because

   sum(x - c for x in data) ** 2 / n
== sum(x - m - e for x in data) ** 2 / n
== (sum(x - m for x in data) - sum(e for x in data))**2 / n
== (0 - n * e)**2 / n
== n * e**2

--

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-08-26 Thread Julien Palard


Julien Palard  added the comment:


New changeset 21fa8547921d28b80b8a88d034081cab000d5480 by Julien Palard in 
branch 'main':
bpo-42238: [doc] Some more make suspicious false positives. (GH-27945)
https://github.com/python/cpython/commit/21fa8547921d28b80b8a88d034081cab000d5480


--

___
Python tracker 

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



[issue14613] time.time can return NaN

2021-08-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

> I propose we close it [...]

Seconded!

--
stage: test needed -> resolved
status: pending -> closed

___
Python tracker 

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



[issue24234] Should we define complex.__complex__ and bytes.__bytes__?

2021-08-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

All done, I think. Closing.

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



[issue44986] Date formats in help messages of argparse

2021-08-26 Thread Matías Senger

Matías Senger  added the comment:

With this change there should be no need to escape anything, and it is still 
compatible with the old formatting. Plus, with the current implementation if 
you forget to escape something like %Y the error message is not helpful at all 
and only happens when invoked with -h option.

--

___
Python tracker 

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



[issue25867] os.stat raises exception when using unicode and no locale is set

2021-08-26 Thread Irit Katriel

Irit Katriel  added the comment:

It's doing this now, so seems like it has been fixed:

% env -i ./python.exe
Python 3.11.0a0 ...
>>> import os
>>> os.stat(u"\xf0")
Traceback (most recent call last):
  File "", line 1, in 
FileNotFoundError: [Errno 2] No such file or directory: 'ð'
>>>

--
nosy: +iritkatriel

___
Python tracker 

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



[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

This issue has been fixed by recent sqlite3 improvements. Suggesting to still 
expand the test suite with tests for defect connection factories.

--
status: open -> pending

___
Python tracker 

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



[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +26413
status: pending -> open
pull_request: https://github.com/python/cpython/pull/27966

___
Python tracker 

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



[issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
status: open -> pending

___
Python tracker 

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



[issue42085] Add dedicated slot for sending values

2021-08-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Oh, my bad. I can't find the enum values of the return type, though 
(PySendResult).

--

___
Python tracker 

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



[issue45000] del __debug__ should be a SyntaxError

2021-08-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6ea6cf22e9d084c27a4fffbbd298098a6ad5b776 by Dong-hee Na in branch 
'3.10':
[3.10] bpo-45000: Update whatsnews about deleting __debug__ (GH-27956) 
(GH-27958)
https://github.com/python/cpython/commit/6ea6cf22e9d084c27a4fffbbd298098a6ad5b776


--

___
Python tracker 

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



[issue45000] del __debug__ should be a SyntaxError

2021-08-26 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



[issue45000] del __debug__ should be a SyntaxError

2021-08-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 32c1caa87f68a650f2d009a589a1db30484499cb by Dong-hee Na in branch 
'3.10':
bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947) (GH-27957)
https://github.com/python/cpython/commit/32c1caa87f68a650f2d009a589a1db30484499cb


--

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
title: tests fail when using pure-python instead of _asycio -> tests fail when 
using pure-python instead of _asyncio

___
Python tracker 

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



[issue44945] Specialize BINARY_ADD using PEP 659 machinery.

2021-08-26 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not know why asyncio.events._get_running_loop was patched in 
FunctionalTestCaseMixin.

--
nosy: +lukasz.langa, pablogsal
priority: normal -> release blocker
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue36073] sqlite crashes with converters mutating cursor

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

This issue was fixed by GH-27884 (bpo-44976). I suggest to expand the test 
suite with the reproducer Sergey provided before closing the issue.

--
status: open -> pending

___
Python tracker 

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



[issue36073] sqlite crashes with converters mutating cursor

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
status: pending -> open
Removed message: https://bugs.python.org/msg400334

___
Python tracker 

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



[issue36073] sqlite crashes with converters mutating cursor

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

After GH-27884 (bpo-44976) there is no longer a segfault.

I suggest to expand the test suite with the reproducer Sergey provided.

--

___
Python tracker 

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



[issue36073] sqlite crashes with converters mutating cursor

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Er, a little bit too fast there. There is still a crash, but it is of course 
postponed bco. bpo-44976. New reproducer:

import sqlite3 as sqlite
con = sqlite.connect(':memory:', detect_types=sqlite.PARSE_COLNAMES)
cur = con.cursor()
sqlite.converters['CURSOR_INIT'] = lambda x: cur.__init__(con)

cur.execute('create table test(x foo)')
cur.execute('insert into test(x) values (?)', ('foo',))
for row in cur.execute('select x as "x [CURSOR_INIT]", x from test'):
print(row)

--

___
Python tracker 

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



[issue45012] DirEntry.stat method should release GIL

2021-08-26 Thread Uosiu

New submission from Stanisław Skonieczny (Uosiu) 
:

We have an application that crawls filesystem using `os.scandir`. It uses 
multiple threads for various things. Application is used on variety of 
filesystems, some of them might be slow or occasionally unresponsive.

We have found out that sometimes whole crawling process is stuck and no thread 
makes any progress, even threads that are really simple, makes no IO and do not 
hold any locks. After running py-spy on process that was stuck we saw that one 
of the threads has entered `dentry.stat(follow_symlinks=False)` line and still 
holds the GIL. Other threads are stuck, because they are waiting for the GIL. 
This situation can take a long time.

I think that `DirEntry` should release GIL when stat cache is empty and syscall 
is performed.

This bug has already been fixed in `scandir` module. See: 
https://github.com/benhoyt/scandir/issues/131

--
components: Library (Lib)
messages: 400337
nosy: Stanisław Skonieczny (Uosiu)
priority: normal
severity: normal
status: open
title: DirEntry.stat method should release GIL
type: behavior
versions: Python 3.10, Python 3.11, Python 3.6, 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



[issue25867] os.stat raises exception when using unicode and no locale is set

2021-08-26 Thread Eryk Sun


Eryk Sun  added the comment:

> It's doing this now, so seems like it has been fixed

Yes. In POSIX systems since Python 3.7, if the LC_CTYPE locale is the legacy 
"C" or "POSIX" locale, by default it tries to coerce LC_CTYPE to "C.UTF-8", 
"C.utf8", or "UTF-8". If coercion fails or is disabled (e.g. by defining 
LC_ALL), the interpreter will still use UTF-8 for the filesystem encoding if 
UTF-8 mode isn't disabled. If UTF-8 mode is also disabled, then ASCII is used. 
For example:

$ LC_CTYPE=C PYTHONCOERCECLOCALE= PYTHONUTF8= python -c 'import sys; 
print(sys.getfilesystemencoding())'
utf-8
$ LC_CTYPE=C PYTHONCOERCECLOCALE=0 PYTHONUTF8= python -c 'import sys; 
print(sys.getfilesystemencoding())'
utf-8
$ LC_CTYPE=C PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 python -c 'import sys; 
print(sys.getfilesystemencoding())'
ascii

--
nosy: +eryksun
resolution:  -> fixed
stage: needs patch -> 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



[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8868d48712aee2b490efaf60bed8dfe9fb14d6b7 by Gregory Anders in 
branch 'main':
bpo-44967: pydoc: return non-zero exit code when query is not found (GH-27868)
https://github.com/python/cpython/commit/8868d48712aee2b490efaf60bed8dfe9fb14d6b7


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44967] pydoc should return non-zero exit code when a query is not found

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks for the report and fix, Gregory! ✨ 🍰 ✨

--
resolution:  -> fixed
stage: patch review -> 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



[issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows

2021-08-26 Thread Luke Rossi


New submission from Luke Rossi :

I saw 33105, but believe this to be a different issue as path length 260 is 
valid.

I did testing by crafting a path that is exactly 260 by hand - A path 259 in 
length reports .isfile() as True.

--
components: Library (Lib)
messages: 400341
nosy: serhiy.storchaka, ubermidget2
priority: normal
severity: normal
status: open
title: os.path.isfile fails on path exactly 260 Chars long in Windows
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows

2021-08-26 Thread Luke Rossi


Luke Rossi  added the comment:

I saw 33105, but believe this to be a different issue as path length 260 is 
valid.

I did testing by crafting a path that is exactly 260 by hand - A path 259 in 
length reports .isfile() as True.

The Stack Error:
[WinError 3] The system cannot find the path specified

--

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26417
pull_request: https://github.com/python/cpython/pull/27970

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 7dc505b8655b3e48b93a4274dfd26e5856d9c64f by Serhiy Storchaka in 
branch 'main':
bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)
https://github.com/python/cpython/commit/7dc505b8655b3e48b93a4274dfd26e5856d9c64f


--

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +26416
pull_request: https://github.com/python/cpython/pull/27969

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 3.0 -> 4.0
pull_requests: +26418
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27971

___
Python tracker 

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



[issue45014] SyntaxError describing the error using a wrong term

2021-08-26 Thread Takuo Matsuoka


New submission from Takuo Matsuoka :

The error is this:

>>> *()
  File "", line 1
SyntaxError: can't use starred expression here


I think it's right SyntaxError is raised here, but the message is
incorrect. Indeed, many starred expressions are actually allowed
there. E.g.,

>>> *(),
()


I happen to have filed in this issue tracker the problem that the
definition of a starred expression given in the Language Reference is
incorrect.

https://bugs.python.org/issue44983

It appears all correct starred expressions and only them are allowed
at the point of the error. Thus the error appears to
be one because "*()" is not a starred expression in the correct
sense. I think the wording in the message should be corrected.

--
components: Interpreter Core
messages: 400344
nosy: Takuo Matsuoka
priority: normal
severity: normal
status: open
title: SyntaxError describing the error using a wrong term
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread miss-islington


miss-islington  added the comment:


New changeset 9f814beadb3ee2c7b37e949a2acf72117a449ffd by Miss Islington (bot) 
in branch '3.10':
bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)
https://github.com/python/cpython/commit/9f814beadb3ee2c7b37e949a2acf72117a449ffd


--

___
Python tracker 

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



[issue45015] Language Reference failing to describe the treatment of starred expressions

2021-08-26 Thread Takuo Matsuoka


New submission from Takuo Matsuoka :

The issue is described as Issue (1) here:

https://mail.python.org/archives/list/python-id...@python.org/message/BEGGQEU6MG7RYIY7HB4I6VQ23L6TXB6H/

Please look at "Note" just before "Issues treated" there as
well. What's mentioned in this note is also filed in this issue tracker
with ID 44983

https://bugs.python.org/issue44983


Coming back to Issue (1), the discrepancy is in the definitions of
yield_expression, return_stmt, augmented_assignment_stmt, and
for_stmt. (That is, the only exception is the definition of
subscription

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

making the exception look inconsistent and confusing.)

https://docs.python.org/3/reference/expressions.html#yield-expressions
https://docs.python.org/3/reference/simple_stmts.html#the-return-statement
https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements
https://docs.python.org/3/reference/compound_stmts.html#the-for-statement

(In case someone is interested in what are proposed over there, a
summary of the proposal can also be found at

https://mail.python.org/archives/list/python-id...@python.org/message/KF37FMD5K5M2ZVTJO6IS3J6M7HHE4VRU/
)

--
assignee: docs@python
components: Documentation
messages: 400346
nosy: Takuo Matsuoka, docs@python
priority: normal
severity: normal
status: open
title: Language Reference failing to describe the treatment of starred 
expressions
versions: Python 3.9

___
Python tracker 

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



[issue45009] Get last modified date of Folders and Files using pathlib module

2021-08-26 Thread Vedran Čačić

Vedran Čačić  added the comment:

It probably has nothing to do with your bug, but your title is wrong. You are 
_not_ getting mtime using pathlib (but using os.path instead). That is done 
like using this approach: 
https://docs.python.org/3/library/pathlib.html#pathlib.Path.stat

Just to eliminate irrelevant details, could you try _actually_ implement the 
algorithm using the above, and see if the results differ?

--
nosy: +veky

___
Python tracker 

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



[issue33092] The bytecode for f-string formatting is inefficient.

2021-08-26 Thread Mark Shannon


Mark Shannon  added the comment:

No significant change in performance 
https://gist.github.com/markshannon/34a780d65e69b5a573a83f3fdb0139aa

I think this merely indicates that there are little to no f-strings in the 
pyperformance benchmark suite.

--

___
Python tracker 

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



[issue45009] Get last modified date of Folders and Files using os.path module

2021-08-26 Thread Gopesh Singh


Gopesh Singh  added the comment:

Updated title. As I used getmtime of os.path module.

--
title: Get last modified date of Folders and Files using pathlib module -> Get 
last modified date of Folders and Files using os.path module

___
Python tracker 

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



[issue45009] Get last modified date of Folders and Files using os.path module

2021-08-26 Thread Gopesh Singh


Gopesh Singh  added the comment:

Thanks Vedram for the response. Changed the title.

But I get the same issue with Path.stat().

When I put a sleep time for each iteration, it works fine. Else, it gives 
current date as modified date.

--

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26420
pull_request: https://github.com/python/cpython/pull/27973

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 989f6a3800f06b2bd31cfef7c3269a443ad94fac by wouter bolsterlee in 
branch 'main':
bpo-45001: Make email date parsing more robust against malformed input 
(GH-27946)
https://github.com/python/cpython/commit/989f6a3800f06b2bd31cfef7c3269a443ad94fac


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26421
pull_request: https://github.com/python/cpython/pull/27974

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26422
pull_request: https://github.com/python/cpython/pull/27975

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26423
pull_request: https://github.com/python/cpython/pull/27976

___
Python tracker 

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



[issue40772] module 'resource' has no attribute 'RLIMIT_VMEM'

2021-08-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

According to https://man7.org/linux/man-pages/man2/getrlimit.2.html there is no 
RLIMIT_VMEM on linux, RLIMIT_AS is the closest equivalent.

--
nosy: +ronaldoussoren
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



[issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows

2021-08-26 Thread Eryk Sun


Eryk Sun  added the comment:

The legacy maximum buffer size is 260 characters, but remember that strings in 
C are terminated by a null character (i.e. "\0"). So the maximum path length is 
actually 259 characters when opening files. 

In Windows 10 with Python 3.6+, you can enable the `LongPathsEnabled` system 
setting to extend the limit up to about 32760 characters. In many cases you can 
also use the "?\\" extended-path prefix to access a long path (e.g. 
r"\\?\C:\some\long\path"), but the path has to be fully qualified and can only 
use backslash as the separator, not forward slash.

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue44990] Change layout of frames back to specials-locals-stack (from locals-specials-stack)

2021-08-26 Thread Mark Shannon


Change by Mark Shannon :


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



[issue44946] Integer operations are inefficient for "medium" integers.

2021-08-26 Thread Mark Shannon


Change by Mark Shannon :


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



[issue45016] Multiprocessing freeze support unclear

2021-08-26 Thread Ronald Oussoren


New submission from Ronald Oussoren :

The requirements on a freezing tool to work with the freeze support in the 
multiprocessing library are unclear.

In particular, I'm trying to support multiprocessing in py2app and cannot rely 
on the documentation to implement that support.

The particular issue I run into:
- With py2app "sys.executable" points to a regular interpreter
- py2app sets sys.frozen to "macosx_app" or "macosx_plugin"
- Multiprocessing.spawn.get_command_line() assumes that a special command-line 
should be used when "sys.frozen" is set and there is no way to disable this.

The easiest way for me to fix this issue is to drop setting sys.frozen in 
py2app, although I have no idea what other code this might break.

--
components: Library (Lib)
messages: 400354
nosy: ronaldoussoren
priority: normal
severity: normal
status: open
title: Multiprocessing freeze support unclear
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45017] move opcode-related logic from modulefinder to dis

2021-08-26 Thread Irit Katriel


New submission from Irit Katriel :

The modulefinder library module has logic that understands particular opcodes 
(such as the scan_opcodes method). This should be encapsulated in the dis 
module, and modulefinder should not process opcodes directly.

--
components: Library (Lib)
messages: 400355
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: move opcode-related logic from modulefinder to dis
type: enhancement
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



[issue45017] move opcode-related logic from modulefinder to dis

2021-08-26 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread miss-islington


miss-islington  added the comment:


New changeset 9a79242567d79f42ad1a953cce2b1c4a94df23ea by Miss Islington (bot) 
in branch '3.10':
bpo-45001: Make email date parsing more robust against malformed input 
(GH-27946)
https://github.com/python/cpython/commit/9a79242567d79f42ad1a953cce2b1c4a94df23ea


--

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 2cdbd3b8b2bb4fa0dbcc04ce305fbafaeedd9e67 by Miss Islington (bot) 
in branch '3.9':
bpo-45001: Make email date parsing more robust against malformed input 
(GH-27946) (GH-27973)
https://github.com/python/cpython/commit/2cdbd3b8b2bb4fa0dbcc04ce305fbafaeedd9e67


--

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 81148c6f91092c3aa207a53b657b2548a20b230c by Miss Islington (bot) 
in branch '3.8':
bpo-45001: Make email date parsing more robust against malformed input 
(GH-27946) (GH-27974)
https://github.com/python/cpython/commit/81148c6f91092c3aa207a53b657b2548a20b230c


--

___
Python tracker 

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



[issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs

2021-08-26 Thread Łukasz Langa

Change by Łukasz Langa :


--
versions: +Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array

2021-08-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> what it's correcting for is an inaccurate value of "c" [...]

I'll leave the logic as-is and just add a note about what is being corrected.

> Numerically, it's probably not helpful.

To make a difference, the mean would have to have huge magnitude relative to 
the variance; otherwise, squaring the error would drown it out to zero.

The mean() should already be accurate to within a 1/2 ulp.  The summation and 
division are exact.  There is only a single rounding when the result converts 
from Fraction to a float or decimal.

--

___
Python tracker 

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



[issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index

2021-08-26 Thread Łukasz Langa

New submission from Łukasz Langa :

Consider the following:

>>> it = iter(range(2**32 + 2))
>>> for _ in range(2**32):
...   _ = next(it)
>>> it2 = pickle.loads(
...   pickle.dumps(it)
... )
>>> assert next(it) == next(it2)

This assert currently fails because the reduce method for range iterator 
objects serializes to `int` instead of `long`.

(note that running this example might take tens of minutes on your box)

--
messages: 400360
nosy: lukasz.langa
priority: normal
severity: normal
stage: patch review
status: open
title: Pickling a range iterator with an index of over sizeof(int) stores an 
invalid index
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index

2021-08-26 Thread Jordan Limor


Change by Jordan Limor :


--
keywords: +patch
nosy: +chilaxan
nosy_count: 1.0 -> 2.0
pull_requests: +26424
pull_request: https://github.com/python/cpython/pull/27938

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 970533e65c1a1129dfc1cc1867f6ad075f7f5bf6 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) 
(GH-27970)
https://github.com/python/cpython/commit/970533e65c1a1129dfc1cc1867f6ad075f7f5bf6


--

___
Python tracker 

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



[issue45011] tests fail when using pure-python instead of _asyncio

2021-08-26 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue45010] Remove support of special method __div__ in unittest.mock

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f9cd40f5e242d3c64cc20a5064500f5fe864f91f by Serhiy Storchaka in 
branch 'main':
bpo-45010: Remove support of special method __div__ in unittest.mock (GH-27965)
https://github.com/python/cpython/commit/f9cd40f5e242d3c64cc20a5064500f5fe864f91f


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue30274] Rename 'name' to 'fullname' argument to ExtensionFileLoader

2021-08-26 Thread Diana Van Straaten


Diana Van Straaten  added the comment:

I want to work on it.

--
nosy: +zemlya3018

___
Python tracker 

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



[issue45010] Remove support of special method __div__ in unittest.mock

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:

Agreed, let's get rid of it. Thanks!

I grepped for this and there's still one left-over here:

https://github.com/python/cpython/blob/f9cd40f5e242d3c64cc20a5064500f5fe864f91f/Lib/importlib/metadata/_meta.py#L40-L41

Fortunately, this was already fixed upstream:

https://github.com/python/importlib_metadata/issues/334

Next time Jason syncs importlib.metadata with upstream this will be solved as 
well. Currently we're synced with 4.6.0 while the fix went in in 4.6.4.

Also fortunately, this is low-pri since this is only in type annotations.

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +26425
pull_request: https://github.com/python/cpython/pull/27977

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset fdcb675eed47b1f6054fae381af4388b16a6fff4 by andrei kulakov in 
branch 'main':
bpo-40635: Fix getfqdn() docstring and docs (GH-27971)
https://github.com/python/cpython/commit/fdcb675eed47b1f6054fae381af4388b16a6fff4


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26426
pull_request: https://github.com/python/cpython/pull/27978

___
Python tracker 

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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Note that sqlite3_enable_load_extension was unavailable way before macOS 
11.5.1, the symbol is not present on 10.15 (I used 'nm 
/usr/lib/libsqlite3.dylib' to check for symbol availability).

Just checking for MACOS and a system include directory should do the trick for 
giving a nicer error message, something like:

diff --git a/setup.py b/setup.py
index bc2ea16089..ae5d827339 100644
--- a/setup.py
+++ b/setup.py
@@ -1601,6 +1601,9 @@ def detect_sqlite(self):
 if '--enable-loadable-sqlite-extensions' not in 
sysconfig.get_config_var("CONFIG_ARGS"):
 sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))
 
+elif MACOS and sqlite_incdir == os.path.join(MACOS_SDK_ROOT, 
'usr/include'): 
+raise DistutilsError("System version of SQLite3 does not 
support loadable extensions") 
+
 if MACOS:
 # In every directory on the search path search for a dynamic
 # library and then a static library, instead of first looking

With this patch I get a nice error message when trying to build with loadable 
sqlite extensions:

make

  (main)cpython
 CC='gcc' LDSHARED='gcc -bundle -undefined dynamic_lookup' OPT='-DNDEBUG -g 
-fwrapv -O3 -Wall'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''   ./python.exe -E 
../setup.py  build
running build
running build_ext
error: System version of SQLite3 does not support loadable extensions
make: *** [sharedmods] Error 1


My clone of the CPython repository is a bit of a mess at the moment, otherwise 
I'd have created a PR for this. Feel free to run with this.

--

___
Python tracker 

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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Thanks, Ronald, that's a nice improvement. I'll create a PR for it.

--

___
Python tracker 

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



[issue44933] python3.9-intel64 hardened runtime not enabled

2021-08-26 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@ned: the "reliable way to run under rosetta" is using "arch -x86_64 python3". 
I don't particularly like having another executable to accomplish the same goal.

--

___
Python tracker 

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



[issue44997] [sqlite3] build fails on macOS 11.5.1

2021-08-26 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
keywords: +patch
pull_requests: +26427
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/27979

___
Python tracker 

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



[issue45019] Freezing modules has manual steps but could be automated.

2021-08-26 Thread Eric Snow


New submission from Eric Snow :

Currently we freeze the 3 main import-related modules, as well as one module 
for testing.  Adding more modules or otherwise making any adjustments requires 
manually editing several files (frozen.c, Makefile.pre.in, ...).  Those files 
aren't particularly obvious and it's easy to miss one.  So it would be helpful 
to have a tool that generates the necessary lines in the relevant files, to 
avoid manual editing.

I'll be putting up a PR shortly.

--
assignee: eric.snow
components: Build
messages: 400369
nosy: brett.cannon, eric.snow, gvanrossum
priority: normal
severity: normal
stage: needs patch
status: open
title: Freezing modules has manual steps but could be automated.
type: enhancement
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



[issue45019] Freezing modules has manual steps but could be automated.

2021-08-26 Thread Eric Snow


Change by Eric Snow :


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

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


New submission from Eric Snow :

Currently we freeze the 3 main import-related modules into the python binary 
(along with one test module).  This allows us to bootstrap the import machinery 
from Python modules.  It also means we get better performance importing those 
modules.

If we freeze modules that are likely to be used during execution then we get 
even better startup times.  I'll be putting up a PR that does so, freezing all 
the modules that are imported during startup.  This could also be done for any 
stdlib modules that are commonly imported.

(also see #45019 and https://github.com/faster-cpython/ideas/issues/82)

--
assignee: eric.snow
components: Build
messages: 400370
nosy: brett.cannon, eric.snow, gvanrossum, nedbat
priority: normal
severity: normal
stage: needs patch
status: open
title: Freeze all modules imported during startup.
type: enhancement
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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


Eric Snow  added the comment:

FYI, with my branch I'm getting a 15% improvement to startup for "./python -c 
pass".

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


Eric Snow  added the comment:

I'm aware of two potentially problematic consequences to this change:

* making changes to those source files for the modules will not be reflected 
during execution until after "make" is run
* tricks to inject hooks ASAP (e.g. coverage.py swaps the encodings module) may 
lose their entry point

For the former, I'm not sure there's a way around it.  We may consider the 
inconvenience worth it in order to get the performance benefits.

For the latter, the obvious solution is to introduce a startup hook (e.g. on 
the CLI) like we've talked about doing for years.  (I wasn't able to find 
previous discussions on that topic after a quick search.)

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Not sure whether you are aware, but the PyRun project I'm maintaining
does that and goes beyond this by freezing almost the complete stdlib
and statically linking most C extensions into a single binary:

https://www.egenix.com/products/python/PyRun/

Startup is indeed better, but not as much as you might think.
You do save stat calls and can share resources across processes.

The big time consumer is turning marshal'ed code objects back
into Python objects, though. If that could be made faster by
e.g. using a more efficient storage format such as one which is
platform dependent, it'd be a much bigger win than the freezing
approach.

--
nosy: +lemburg

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


Eric Snow  added the comment:

> The big time consumer is turning marshal'ed code objects back
> into Python objects, though. If that could be made faster by
> e.g. using a more efficient storage format such as one which is
> platform dependent, it'd be a much bigger win than the freezing
> approach.

That's something Guido has been exploring. :)

See: https://github.com/faster-cpython/ideas/issues/84 (and others)

--

___
Python tracker 

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



[issue30274] Rename 'name' to 'fullname' argument to ExtensionFileLoader

2021-08-26 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 6.0 -> 7.0
pull_requests: +26429
pull_request: https://github.com/python/cpython/pull/27981

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Ned Batchelder


Change by Ned Batchelder :


--
nosy:  -nedbat

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread miss-islington


miss-islington  added the comment:


New changeset 719af92e108ea3b31729cb09077673b8f13905d2 by Miss Islington (bot) 
in branch '3.10':
bpo-40635: Fix getfqdn() docstring and docs (GH-27971)
https://github.com/python/cpython/commit/719af92e108ea3b31729cb09077673b8f13905d2


--

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread miss-islington


miss-islington  added the comment:


New changeset f1e3fc4631da5e6ca1ea047c82bd9b42db9dd9ae by Miss Islington (bot) 
in branch '3.9':
bpo-40635: Fix getfqdn() docstring and docs (GH-27971)
https://github.com/python/cpython/commit/f1e3fc4631da5e6ca1ea047c82bd9b42db9dd9ae


--

___
Python tracker 

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



[issue45007] OpenSSL 1.1.1l is released

2021-08-26 Thread Steve Dower


Steve Dower  added the comment:

The new build and tags for Windows are up.

--

___
Python tracker 

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



[issue40635] Documentation for socket.getfqdn incorrect?

2021-08-26 Thread Łukasz Langa

Change by Łukasz Langa :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue45021] Race condition in thread.py

2021-08-26 Thread nullptr


New submission from nullptr :

The following code can sometimes hang up


import random 
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from time import sleep

def worker():   
with ProcessPoolExecutor() as pool:  
r = list(pool.map(sleep, [0.01] * 8))   

   
if __name__ == '__main__': 
pool = ThreadPoolExecutor() 
   
i = 0  
while True:
if random.random() < 0.9:
pool.submit(sleep, 0.001)  
else: 
r = pool.submit(worker) 
r = r.result()
i += 1   
print('alive', i)


It's a bit hard to trigger that way but with some luck and many restarts it'll 
eventually freeze as r.result() never returns.

The backtrace from a child process shows that the child is stuck in 
Lib/concurrent/futures/thread.py:_python_exit waiting for _global_shutdown_lock.

The fork happened while the lock was already grabbed i.e. while executing 
ThreadPoolExecutor.submit

--
components: Library (Lib)
messages: 400378
nosy: xavier.lacroze
priority: normal
severity: normal
status: open
title: Race condition in thread.py
versions: Python 3.9

___
Python tracker 

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



[issue34804] Repetition of 'for example' in documentation

2021-08-26 Thread Diana


Diana  added the comment:

I will handle it. I will send a pull request within 3 days.

--
nosy: +DonnaDia

___
Python tracker 

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



[issue45021] Race condition in thread.py

2021-08-26 Thread nullptr


Change by nullptr :


--
type:  -> behavior

___
Python tracker 

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



[issue45021] Race condition in thread.py

2021-08-26 Thread nullptr


nullptr  added the comment:

A more direct way to reproduce


from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from time import sleep

def worker():
with ProcessPoolExecutor() as pool:
r = list(pool.map(sleep, [0.01] * 8))


def submit(pool):
pool.submit(submit, pool)


if __name__ == '__main__':
pool = ThreadPoolExecutor(2)
pool.submit(submit, pool)

i = 0
while True:
r = pool.submit(worker)
r = r.result()
print(i)
i += 1

--

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-08-26 Thread Eric Snow


Eric Snow  added the comment:

> For the latter, the obvious solution is to introduce a startup hook

I'm not sure why I said "obvious".  Sorry about that.

--

___
Python tracker 

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



[issue45022] Update libffi to 3.4.2

2021-08-26 Thread Steve Dower


New submission from Steve Dower :

libffi is doing releases again! We're a few versions behind, so should pull in 
the latest. https://github.com/libffi/libffi/

Adding RMs for opinions on backporting, and Ned in case this impacts the macOS 
build.

--
components: Build, Windows, ctypes
messages: 400382
nosy: lukasz.langa, ned.deily, pablogsal, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Update libffi to 3.4.2
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



  1   2   >