[issue42160] unnecessary overhead in tempfile

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

The commit 8e409cebad42032bb7d0f2cadd8b1e36081d98af introduced a reference leak:
https://buildbot.python.org/all/#/builders/320/builds/71

$ make && ./python -m test test_tempfile -R 3:3
...
test_tempfile leaked [49, 49, 49] references, sum=147
test_tempfile leaked [28, 28, 28] memory blocks, sum=84
...

Single test reproducing the leak:

$ ./python -m test test_tempfile -R 3:3 -m 
test.test_tempfile.TestGetDefaultTempdir.test_no_files_left_behind
...
test_tempfile leaked [21, 21, 21] references, sum=63
test_tempfile leaked [12, 12, 12] memory blocks, sum=36
...

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

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



[issue42211] CRASH

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

This is a strange copy of my bpo-42208 issue...

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Using logging or warnings during Python finalization does crash 
Python

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



[issue26528] NameError for built in function open when re-raising stored exception from yielded function

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

Davide Rizzo:
> I've just stumbled on the same thing happening on some code that attempts to 
> use logging on __del__.
> (...)
> File ".../logging/__init__.py", line 1121, in _open
> NameError: name 'open' is not defined

This is bpo-26789 which is unrelated to this issue.

--

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



[issue26789] logging: Trying to log during Python finalization with NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

Attached PR 23053 fix the root issue of the infamous "NameError: name 'open' is 
not defined" error in the logging module.

--

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



[issue26789] logging: Trying to log during Python finalization with NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

Note: Attached error.py no longer works with a recent aiohttp version.

--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

I fixed all issues which prevented to fix bpo-26789, I close thie issue.

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

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b62bdf71ea0cd52041d49691d8ae3dc645bd48e1 by Victor Stinner in 
branch 'master':
bpo-42208: Add _locale._get_locale_encoding() (GH-23052)
https://github.com/python/cpython/commit/b62bdf71ea0cd52041d49691d8ae3dc645bd48e1


--

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



[issue26789] logging: Trying to log during Python finalization with NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


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

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21971
pull_request: https://github.com/python/cpython/pull/23052

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 710e82630775774dceba5e8f24b1b10e6dfaf9b7 by Victor Stinner in 
branch 'master':
bpo-42208: Add _Py_GetLocaleEncoding() (GH-23050)
https://github.com/python/cpython/commit/710e82630775774dceba5e8f24b1b10e6dfaf9b7


--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> This change renames collect() to gc_collect_main(). It broke test_gdb on 
> buildbots, whereas test_gdb passed on Travis CI on my PR 23038. Also, 
> test_gdb is skipped on the Ubuntu job of GitHub Action since gdb is not 
> installed. I created https://github.com/python/core-workflow/issues/383 to 
> add gdb to Ubuntu dependencies. My PR 23043 adds gdb dependency.

Fixed by:

commit 6e03c0ad156797cd6e9132e895d55dac0344d340 (upstream/master, master)
Author: Victor Stinner 
Date:   Fri Oct 30 22:52:30 2020 +0100

GitHub Action: Add gdb to posix dependencies (GH-23043)

Sort also dependencies and remove duplicates (liblzma-dev).

--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21969
pull_request: https://github.com/python/cpython/pull/23050

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



[issue42173] Drop Solaris support

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

Jakub: Would you mind to build the master branch of Python, run the test suite 
and post the tests results? In short:

git clone https://github.com/python/cpython.git
cd cpython
./configure
./python -m test -j0 -r

If possible, try to install dependencies (readline, lzma, etc.).

If there are failures, please copy them into a file, and attach the file to 
this issue.

It is to have an idea if it would be worth it to add a Python buildbot running 
on Solaris. If there are too many failures, it would be better to fix first 
most failures before considering to add a buildbot.

--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 09c6120be8c70366495b027ae3daa213609de3ed by Miss Skeleton (bot) 
in branch '3.9':
 bpo-42208: GitHub Action: Add gdb to posix dependencies (GH-23043) (GH-23047)
https://github.com/python/cpython/commit/09c6120be8c70366495b027ae3daa213609de3ed


--

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



[issue42214] Parser/pegen.c:68: _PyPegen_check_barry_as_flufl: Assertion `t->type == NOTEQUAL' failed

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

In release mode, there is no assertion error:

$ python3.10 pgen_bug.py 
  File "/home/vstinner/python/master/pgen_bug.py", line 6
try
   ^
SyntaxError: invalid syntax

--

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



[issue42214] Parser/pegen.c:68: _PyPegen_check_barry_as_flufl: Assertion `t->type == NOTEQUAL' failed

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +BTaskaya

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



[issue42214] Parser/pegen.c:68: _PyPegen_check_barry_as_flufl: Assertion `t->type == NOTEQUAL' failed

2020-10-30 Thread STINNER Victor


New submission from STINNER Victor :

When Python is built in debug mode, it fails with an assertion error on the 
following code:
---
def func1():
if a != b:
raise ValueError

def func2():
try
return 1
finally:
pass
---

Try attached pgen_bug.py:

$ ./python pgen_bug.py 
python: Parser/pegen.c:68: _PyPegen_check_barry_as_flufl: Assertion `t->type == 
NOTEQUAL' failed.
Abandon (core dumped)

--
components: Interpreter Core
files: pgen_bug.py
messages: 380002
nosy: gvanrossum, lys.nikolaou, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: Parser/pegen.c:68: _PyPegen_check_barry_as_flufl: Assertion `t->type == 
NOTEQUAL' failed
versions: Python 3.10
Added file: https://bugs.python.org/file49555/pgen_bug.py

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



[issue42214] Parser/pegen.c:68: _PyPegen_check_barry_as_flufl: Assertion `t->type == NOTEQUAL' failed

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

Barry: what did you do?

--
nosy: +barry

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset eba5bf2f5672bf4861c626937597b85ac0c242b9 by Victor Stinner in 
branch 'master':
bpo-42208: Call GC collect earlier in PyInterpreterState_Clear() (GH-23044)
https://github.com/python/cpython/commit/eba5bf2f5672bf4861c626937597b85ac0c242b9


--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21963
pull_request: https://github.com/python/cpython/pull/23044

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21962
pull_request: https://github.com/python/cpython/pull/23043

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-42208: Pass tstate to _PyGC_CollectNoFail() (GH-23038)
> https://github.com/python/cpython/commit/8b3414818f5289eac530bf38bcfbd7b2b851805c

This change renames collect() to gc_collect_main(). It broke test_gdb on 
buildbots, whereas test_gdb passed on Travis CI on my PR 23038. Also, test_gdb 
is skipped on the Ubuntu job of GitHub Action since gdb is not installed. I 
created https://github.com/python/core-workflow/issues/383 to add gdb to Ubuntu 
dependencies. My PR 23043 adds gdb dependency.

--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b9ee4af4c643a323779fd7076e80b29d611f2709 by Victor Stinner in 
branch 'master':
bpo-42208: Fix test_gdb for gc_collect_main() name (GH-23041)
https://github.com/python/cpython/commit/b9ee4af4c643a323779fd7076e80b29d611f2709


--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset dff1ad509051f7e07e77d1e3ec83314d53fb1118 by Victor Stinner in 
branch 'master':
bpo-42208: Move _PyImport_Cleanup() to pylifecycle.c (GH-23040)
https://github.com/python/cpython/commit/dff1ad509051f7e07e77d1e3ec83314d53fb1118


--

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



[issue26789] logging: Trying to log during Python finalization with NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> Issue26789. asyncio creates reference loops which caused to executing code 
> late at shutdown, and that code uses logging which always fail.

Well, I suggest to attempt fixing logging.

The reference cycle in asyncio.Task.set_exception() is *by design*. It's really 
trick to fix it. Since the creation of asyncio, nobody managed to find a 
solution to fix it. Once I propose to create an asyncio task forcing a GC 
collection every minute, but it was never implemented.

If you have a clever idea to fix Task.set_exception() design, please open a 
separated issue.

--

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



[issue39513] NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> Issue26789 is about asyncio, but this issue about logging.

I chose to reassign Issue26789 to the logging module.

--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21960
pull_request: https://github.com/python/cpython/pull/23041

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



[issue42042] sphinx3 renders diffrently docs.python.org for 3.10

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21959
pull_request: https://github.com/python/cpython/pull/23040

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8b3414818f5289eac530bf38bcfbd7b2b851805c by Victor Stinner in 
branch 'master':
bpo-42208: Pass tstate to _PyGC_CollectNoFail() (GH-23038)
https://github.com/python/cpython/commit/8b3414818f5289eac530bf38bcfbd7b2b851805c


--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


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

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


New submission from STINNER Victor :

If you apply attached logging.patch, Python crash using attached crash.py:

$ echo|./python -i crash.py
>>>
>>> 
python: Python/_warnings.c:872: setup_context: Assertion `globals != NULL' 
failed.
Abandon (core dumped)


Attached logging.patch is a fix for bpo-26789: logging.FileHandler keeps a 
reference to the builtin open() function.

Attached crash.py does crash because of an unclosed file. It happens after 
PyInterpreterState_Clear(), in finalize_interp_clear():

/* Last explicit GC collection */
_PyGC_CollectNoFail();

setup_context() of Python/_warings.c does crash because tstate->interp->sysdict 
is NULL at this point.

Moreover, _io.TextIOWrapper.__init__() fails to import the locale module (to 
call locale.getpreferredencoding(), since the encoding is None) and picks the 
"ascii" encoding.

Moreover, even if I work around all these issues, _warnings.showwarnings() logs 
"lost sys.stderr" into stderr because, again, tstate->interp->sysdict is NULL 
at this point (and so sys.stderr no longer exists).

It looks like a bug in finalize_interp_clear() which triggers a garbage 
collection, whereas Python is no longer usable.

--

The logging module does automatically close files at exit using:

   atexit.register(shutdown)

But crash.py, a new file is opened by a logging handler after 
logging.shutdown() is called. Maybe another problem is that the logging module 
does not clear logger handlers, or prevent handlers to log more message, after 
shutdown() is called.

--
components: Interpreter Core
files: logging.patch
keywords: patch
messages: 379974
nosy: vstinner
priority: normal
severity: normal
status: open
title: Using logging or warnings during Python finalization does crash Python
versions: Python 3.10
Added file: https://bugs.python.org/file49553/logging.patch

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



[issue26789] logging: Trying to log during Python finalization with NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> It looks like a bug in finalize_interp_clear() which triggers a garbage 
> collection, whereas Python is no longer usable.

I created bpo-42208 "Using logging or warnings during Python finalization does 
crash Python".

--

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



[issue42208] Using logging or warnings during Python finalization does crash Python

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file49554/crash.py

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



[issue26789] logging: Trying to log during Python finalization with NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

I hacked logging.FileHandler to keep a reference to the builtin open() 
function. I got new problems.

In my test, I got a crash because of an unclosed file. It happens after 
PyInterpreterState_Clear(), in finalize_interp_clear():

/* Last explicit GC collection */
_PyGC_CollectNoFail();

setup_context() of Python/_warings.c does crash because tstate->interp->sysdict 
is NULL at this point.

Moreover, _io.TextIOWrapper.__init__() fails to import the locale module (to 
call locale.getpreferredencoding(), since the encoding is None) and picks the 
"ascii" encoding.

Moreover, even if I work around all these issues, _warnings.showwarnings() logs 
"lost sys.stderr" into stderr because, again, tstate->interp->sysdict is NULL 
at this point (and so sys.stderr no longer exists).

It looks like a bug in finalize_interp_clear() which triggers a garbage 
collection, whereas Python is no longer usable.

--

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



[issue26789] logging: Trying to log during Python finalization with NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-39513 and bpo-42203 as duplicates of this issue.

I changed the title to reflect that the root issue is that logging during 
Python finalization can fail with NameError: name 'open' is not defined.

--
components: +Library (Lib) -asyncio
nosy: +vstinner
title: asyncio: Please do not log during shutdown -> logging: Trying to log 
during Python finalization with NameError: name 'open' is not defined
versions: +Python 3.10 -Python 3.5

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



[issue39513] NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a duplicate of bpo-26789.

--
nosy: +vstinner
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> asyncio: Please do not log during shutdown

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



[issue42203] Unexpected behaviour NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a duplicate of bpo-26789.

--
nosy: +vstinner
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> asyncio: Please do not log during shutdown

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



[issue41839] Solaris: Fix error checking in sched_get_priority_ functions

2020-10-30 Thread STINNER Victor


Change by STINNER Victor :


--
title: Fix error checking in sched_get_priority_ functions -> Solaris: Fix 
error checking in sched_get_priority_ functions

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



[issue42173] Drop Solaris support

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> But it's not enough, please call for help:

Please *read* my call for help

--

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



[issue42173] Drop Solaris support

2020-10-30 Thread STINNER Victor

STINNER Victor  added the comment:

It seems like two Python core developers (Ronald Oussoren and Jesús Cea Avión) 
are volunteer to maintain the Solaris support. Moreover, it seems like some 
people would like to provide a Solaris server to run a buildbot server. In this 
case, I would be fine to keep the Solaris code.

But it's not enough, please call for help:
https://mail.python.org/archives/list/python-...@python.org/message/NYWF4DUPFYZSKUUZ3ZHOSBQCWAF4IIQO/

--

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



[issue39715] Implement __repr__ methods for AST classes

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

I reject the feature request.

While repr() on AST nodes could be enhanced for some specific nodes, you have 
to know that the code is mostly implemented in C which make enhancements 
non-trivial. Moreover, this code (Python/Python-ast.c) is generated by a script 
(Parser/asdl_c.py) which makes it even worse to enhance.

I suggest you to develop tooling outside of the stdlib to format an AST tree or 
a list of AST nodes, something like pprint and reprlib modules. It would 
benefit to more Python versions and will give you way more freedom on how to 
format these nodes.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

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



[issue39715] Implement __repr__ methods for AST classes

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not sure that it's a good idea to make repr(_ast.AST) longer. I suggest to 
reject this feature request. As Serhiy wrote, ast.dump() can already be used.

--
nosy: +vstinner

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



[issue42173] Drop Solaris support

2020-10-29 Thread STINNER Victor


STINNER Victor  added the comment:

> We (illumos) share the same uname "SunOS" and depend on this support.

Which Python version do you use?

https://blogs.oracle.com/solaris/future-of-python-on-solaris mentions Python 
2.7 and 3.4.

--

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



[issue42173] Drop Solaris support

2020-10-29 Thread STINNER Victor


STINNER Victor  added the comment:

I looked at PyPI download statistics of the "six" module over the last 180 days 
(6 months), grouped by operating system name:

* SunOS: 3,975 downloads
* TOTAL: 590,727,298 downloads

SunOS is 0.0007% of all six downloads.

For comparison, the top 4 is:

* Linux: 91% (535,804,817)
* Windows: 4% (21,053,173)
* : 3% (18,695,360)
* macOS (Darwin): 3% (14,776,993)

Raw data of the top 14:

num_downloads,system_name
535804817,Linux
21053173,Windows
18695360,
14776993,Darwin
347090,FreeBSD
9759,Qnx
5350,Java
3975,SunOS
3178,CYGWIN_NT-10.0-14393
3177,CYGWIN_NT-10.0-17763
2505,CYGWIN_NT-10.0-18363
2263,AIX
2061,NetBSD
1891,OpenBSD

--

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



[issue42197] Disable automatic update of frame locals during tracing

2020-10-29 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

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



[issue42029] Remove dynload_dl.c

2020-10-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5776663675b48f011d428a5874cc3c79d1deb59e by Victor Stinner in 
branch 'master':
bpo-42029: Remove IRIX code (GH-23023)
https://github.com/python/cpython/commit/5776663675b48f011d428a5874cc3c79d1deb59e


--

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



[issue40255] Fixing Copy on Writes from reference counting

2020-10-29 Thread STINNER Victor


STINNER Victor  added the comment:

> Fast shutdown option

You can use os._exit(0).

--

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



[issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval

2020-10-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21940
pull_request: https://github.com/python/cpython/pull/23024

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-10-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21941
pull_request: https://github.com/python/cpython/pull/23024

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



[issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once

2020-10-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21939
pull_request: https://github.com/python/cpython/pull/23024

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



[issue41796] _ast module state should be made per interpreter

2020-10-29 Thread STINNER Victor


Change by STINNER Victor :


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

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



[issue42029] Remove dynload_dl.c

2020-10-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21937
pull_request: https://github.com/python/cpython/pull/23023

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Raymond, I fixed the code.

I close the issue, I removed _PyLong_Zero and _PyLong_One variables.

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

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 35b95aaf21534e4a8e3370dfd6f7482265316c9e by Victor Stinner in 
branch 'master':
bpo-42161: Micro-optimize _collections._count_elements() (GH-23008)
https://github.com/python/cpython/commit/35b95aaf21534e4a8e3370dfd6f7482265316c9e


--

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



[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

>  functions who's point is to be fast and not consume an amount of memory 
> determined by the input data

I proposed to read the first 4 bytes of the file. It's a fixed length.

--

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c310185c081110741fae914c06c7aaf673ad3d0d by Victor Stinner in 
branch 'master':
bpo-42161: Remove private _PyLong_Zero and _PyLong_One (GH-23003)
https://github.com/python/cpython/commit/c310185c081110741fae914c06c7aaf673ad3d0d


--

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

> Why did you put _PyLong_GetOne() inside the loop for the fast path and 
> outside the loop for the slow path?

Oh, I didn't notice that the first part was also a loop. I wrote PR 23008 to 
move the call out of the loop.

I tried to avoid calling the function if it's possible that the variable it not 
used. But here, it's always used, so it's relevant to move the loop invariant 
out of the loop ;-)

--

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21924
pull_request: https://github.com/python/cpython/pull/23008

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



[issue6761] Class calling

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 95f710c55714153f0c8cce48f8215bb3d866ac1d by Andre Delfino in 
branch 'master':
bpo-6761: Enhance __call__ documentation (GH-7987)
https://github.com/python/cpython/commit/95f710c55714153f0c8cce48f8215bb3d866ac1d


--
nosy: +vstinner

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21918
pull_request: https://github.com/python/cpython/pull/23003

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 37834136d0afe51d274bfc79d8705514cbe73727 by Victor Stinner in 
branch 'master':
bpo-42161: Modules/ uses _PyLong_GetZero() and _PyLong_GetOne() (GH-22998)
https://github.com/python/cpython/commit/37834136d0afe51d274bfc79d8705514cbe73727


--

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



[issue42173] Drop Solaris support

2020-10-27 Thread STINNER Victor


Change by STINNER Victor :


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

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



[issue42173] Drop Solaris support

2020-10-27 Thread STINNER Victor

New submission from STINNER Victor :

In past years, very few Python core developers took care of the Solaris 
support. The latest significant Solaris enhancement was in 2018 with the 
addition of a new Solaris st_fstype attribute to os.stat(), in Python 3.7, by 
Jesús Cea Avión (bpo-32659).

Another recent Solaris-related change is bpo-41687: "Fix implementation of 
sendfile to be compatible with Solaris".

On the Oracle side, there was an article about Python on Solaris in 2019:
"Future of Python on Solaris" by  Darren Moffat 
https://blogs.oracle.com/solaris/future-of-python-on-solaris

I now that Giampaolo Rodola cares of the Solaris support for his psutil project:
https://github.com/giampaolo/psutil/

It's unclear to me if Oracle still plans to maintain Solaris. The latest 
release was published 2 years ago. The Wikipedia article says: "While Oracle 
did have a large layoff of Solaris development engineering staff, development 
continues today of which Solaris 11.4 was released in 2018."
https://en.wikipedia.org/wiki/Solaris_(operating_system)

There is currently 25 open issues which could be closed if we drop the Solaris 
support.

See also the PEP 11 for the process.

I asked asked 4 years ago (in 2016) if Solaris support should/can be removed:
"OpenIndiana and Solaris support"
https://mail.python.org/archives/list/python-...@python.org/message/NOT2RORSNX72ZLUHK2UUGBD4GTPNKBUS/

Python has no longer buildbot workers running on Solaris or a Solaris variant 
(OpenIndiana, Illumos, etc.).

I propose to drop the Solaris support in Python to reduce the maintenance 
burden.

Python has a few features specific to Solaris:

* st_fstype attribute of os.stat()
* select.devpoll and selectors.DevpollSelector
* time.CLOCK_HIGHRES constant
* stat.S_ISDOOR()
* tarfile: "Solaris extended header" (no need to remove this one)

Solaris has many names and variants:

* SunOS
* SRV4
* Solaris
* Illumos (still active in July 2020 at least)
* OpenSolaris: "On Friday, August 13, 2010, details started to emerge relating 
to the discontinuation of the OpenSolaris project and the pending release of a 
new closed-source, proprietary version of Solaris, Solaris 11." says Wikipedia
* OpenIndiana (latest release in 2020)

I'm not sure on how to process? Deprecate all Solaris-specific features in 
Python 3.10, make sure that Python 3.11 cannot be built on Solaris anymore, and 
drop the code in Python 3.12? Or drop everything as soon as possible in Python 
3.10?

The alternative is to leave the code unchanged and let the code slowly die, as 
we did for other platforms like HP-UX and IRIX.

See also my notes on platforms supported by Python:
https://pythondev.readthedocs.io/platforms.html

Attached draft PR gives an idea on how much code can be removed if Solaris 
support is removed. A coase estimation is the removal of 700 lines:

 Doc/c-api/init.rst   |   3 +-
 Doc/distutils/apiref.rst |   1 -
 Doc/library/gettext.rst  |  10 +-
 Doc/library/os.rst   |  12 +-
 Doc/library/platform.rst |   5 +-
 Doc/library/posix.rst|   8 +-
 Doc/library/sys.rst  |   3 +-
 Doc/library/sysconfig.rst|   1 -
 Doc/library/time.rst |  13 +-
 Doc/using/unix.rst   |   7 -
 Include/pyport.h |   5 -
 Lib/cgi.py   |   4 +-
 Lib/ctypes/test/test_byteswap.py |   2 +-
 Lib/ctypes/util.py   | 100 ++
 Lib/distutils/command/bdist.py   |   2 +-
 Lib/distutils/tests/support.py   |   2 +-
 Lib/distutils/tests/test_build_ext.py|  21 --
 Lib/distutils/util.py|  11 --
 Lib/gettext.py   |   3 -
 Lib/logging/handlers.py  |   2 -
 Lib/platform.py  |  27 +--
 Lib/sysconfig.py |  11 --
 Lib/test/fork_wait.py|   4 +-
 Lib/test/subprocessdata/fd_status.py |   3 -
 Lib/test/test__locale.py |  24 ---
 Lib/test/test_asyncio/test_sendfile.py   |   6 -
 Lib/test/test_asyncore.py|   2 -
 Lib/test/test_cmd_line.py|   2 +-
 Lib/test/test_curses.py  |   2 +-
 Lib/test/test_fileio.py  |   2 +-
 Lib/test/test_importlib/import_/test_path.py |   2 +-
 Lib/test/test_locale.py  |   2 +-
 Lib/test/test_os.py  |  14 +-
 Lib/test/test_posix.py   |   7 +-
 Lib/test/test_pty.py |   4 -
 Lib/test/test_selectors.py   |   2 +-
 Lib/test/test_shutil.py  |   2 +-
 Lib/test/test_socket.py 

[issue32659] Solaris "stat" should support "st_fstype"

2020-10-27 Thread STINNER Victor


Change by STINNER Victor :


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

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

Miro:
> I don't understand the rationale for this change in depth, but does the 
> benefit outweigh (yet another) backwards incompatibility?

I wrote PEP 620 "Hide implementation details from the C API" to explain the 
rationale:
https://www.python.org/dev/peps/pep-0620/

--

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-10-27 Thread STINNER Victor


STINNER Victor  added the comment:

Miro:
> This also breaks pycurl:
> https://github.com/pycurl/pycurl/pull/660

Right, see my previous comment, another PR was already proposed in May!

me:
> This change broke pycurl:
> https://github.com/pycurl/pycurl/pull/636

Merged pycurl fix:
https://github.com/pycurl/pycurl/commit/e633f9a1ac4df5e249e78c218d5fbbd848219042

--

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



[issue41052] Opt out serialization/deserialization for heap type

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the fix Serhiy!

--

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



[issue31818] [macOS] _scproxy.get_proxies() crash -- get_proxies() is not fork-safe?

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

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



[issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> Also note that the capsule generally needs to hold references to the objects 
> in exposes

Oh right, that's a great advice!

--

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



[issue38324] [Windows] test__locale fails on Windows local machines

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset f2312037e3a974d26ed3e23884f94c6af111a27a by TIGirardi in branch 
> 'master':
> bpo-38324: Fix test__locale.py Windows failures (GH-20529)

Oh wow, that's a nice enhancmement of the Windows implementation of the locale 
module! It's way better than just skipping tests on Windows ;-) Thanks for this 
fix!

--

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



[issue13451] sched.py: speedup cancel() method

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

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



[issue15125] argparse: positional arguments containing - in name not handled well

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

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



[issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

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



[issue41474] Missing dependency on Include/cpython/frameobject.h

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


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

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



[issue41474] Missing dependency on Include/cpython/frameobject.h

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a6879d9445f98833c4e300e187956e2a218a2315 by Victor Stinner in 
branch 'master':
bpo-41474, Makefile: Add dependency on cpython/frameobject.h (GH-22999)
https://github.com/python/cpython/commit/a6879d9445f98833c4e300e187956e2a218a2315


--

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

I kept unicodedata.ucd_3_2_0 and added a comment to explain why it's still 
relevant in 2020.

I'm done with tasks listed in this issue, so I close it.

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

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 84f7382215b9e024a5590454726b6ae4b0ca70a0 by Victor Stinner in 
branch 'master':
bpo-42157: Rename unicodedata.ucnhash_CAPI (GH-22994)
https://github.com/python/cpython/commit/84f7382215b9e024a5590454726b6ae4b0ca70a0


--

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



[issue42074] setup error on windows

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

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



[issue41736] test_site: test_s_option() failed on AMD64 Windows8.1 Refleaks 3.7

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> Unless refleaks are considered security holes,

This issue is unrelated to reference leak. It's just that when you run 
test_site multiple times, it fails sometimes. It looks like a race condition in 
the test.

My notes on unstable tests:
https://pythondev.readthedocs.io/unstable_tests.html


> On Windows 10 and master, I ran 12 copies of test_site in parallel 10 times.  
> Then I ran -R 3:100 3 times.  All pass.  

Maybe test_site only fails when other tests are run in parallel.

--

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



[issue32122] Improve -x option documentation

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

The -x command line option is now stored as PyConfig.skip_source_first_line, 
documented as:
"Skip the first line of the source?"
https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.skip_source_first_line

Include/cpython/initconfig.h contains a longer comment:

/* Skip the first line of the source ('run_filename' parameter),
   allowing use of non-Unix forms of "#!cmd".
   This is intended for a DOS specific hack only.

   Set by the -x command line option. */
int skip_source_first_line;

--

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



[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

ZipFile.open() checks the first 4 bytes:

# Skip the file header:
fheader = zef_file.read(sizeFileHeader)
if len(fheader) != sizeFileHeader:
raise BadZipFile("Truncated file header")
fheader = struct.unpack(structFileHeader, fheader)
if fheader[_FH_SIGNATURE] != stringFileHeader:
raise BadZipFile("Bad magic number for file header")

But is_zipfile() does not. Code could be shared for that.

.gz and .zip files don't start by the same bytes, so this check should reduce 
the number of false positives.

--

You may have a look at the validate() methods of my old Hachoir project, they 
check a few bytes to check if a file looks a valid gzip or ZIP archive.

gzip:

https://github.com/vstinner/hachoir/blob/0f56883d7cea7082e784bfbdd2882e0f2dd2f34b/hachoir/parser/archive/gzip_parser.py#L51-L62

zip:

https://github.com/vstinner/hachoir/blob/0f56883d7cea7082e784bfbdd2882e0f2dd2f34b/hachoir/parser/archive/zip.py#L411-L430

--

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



[issue12737] str.title() is overzealous by upcasing combining marks inappropriately

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> The version 3.2.0 is needed for IDNA compatibility (...)

Oh, I missed your comment. I also discovered it by trying to remove it :-)

So I think that the last thing to do for this issue is to remove 
unicodedata.ucnhash_CAPI: PR 22994.

--
components: +Unicode
nosy: +ezio.melotti

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



[issue36225] [subinterpreters] Lingering subinterpreters should be implicitly cleared on shutdown

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

If tomorrow Python allows to run two interpreters in parallel (see bpo-40512: 
"Meta issue: per-interpreter GIL"), I don't think that it will be safe to 
execute object finalizers of a subinterpreter from the main interpreter in 
Py_Finalize().

IMO subinterpreters must be finalized manually by the programmer, since it's 
too tricky.

The safest option is to display a warning in Py_Finalize() if there are running 
subinterpreters.

--

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



[issue42051] [security] Avoid plistlib XML vulnerabilities by rejecting entity directives

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Ronald Oussoren for the fix. It's better to fix a vulnerability (denial 
of service in this case) rather than documenting it :-)

--

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



[issue41944] [security] Python testsuite calls eval() on content received via HTTP

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the fix Serhiy and thanks Florian Bruhin for the bug report!

--

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



[issue41474] Missing dependency on Include/cpython/frameobject.h

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


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

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



[issue38980] Compile libpython with -fno-semantic-interposition

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

Since Fedora and RHEL build Python with -fno-semantic-interposition, we did not 
get any user bug report about the LD_PRELOAD use case. IMO we can safely 
consider that no user rely on LD_PRELOAD to override libpython symbols.

Thanks for implementing the feature Pablo and Petr!

--

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21913
pull_request: https://github.com/python/cpython/pull/22998

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c9bc290dd6e3994a4ead2a224178bcba86f0c0e4 by Victor Stinner in 
branch 'master':
bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (GH-22995)
https://github.com/python/cpython/commit/c9bc290dd6e3994a4ead2a224178bcba86f0c0e4


--

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

I reported the issue to Fedora: 
https://bugzilla.redhat.com/show_bug.cgi?id=1891657

--

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> Yeah, now try to compile with LTO and CFLAGS='-O0'

Using LTO:

* "-O1 -finline-functions -finline-small-functions -fpartial-inlining" 
reproduces the issue.
* "-O1" does not reproduce the issue.

--

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

With LTO, compile.o requires an undefined _Py_Mangle symbol:

$ gcc -pthread -c -DNDEBUG -fwrapv -O3 -std=c99 -fvisibility=hidden -flto 
-I./Include/internal  -I. -I./Include -DPy_BUILD_CORE -o Python/compile.o 
Python/compile.c; nm Python/compile.o | grep _Py_Mangle

 U _Py_Mangle


Without LTO, compile.o defines _Py_Mangle symbol:

$ gcc -pthread -c -DNDEBUG -fwrapv -O3 -std=c99 -fvisibility=hidden 
-I./Include/internal  -I. -I./Include -DPy_BUILD_CORE -o Python/compile.o 
Python/compile.c; nm Python/compile.o | grep _Py_Mangle

3c20 T _Py_Mangle

--

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

I reproduced the bug on Fedora 32 with gcc-10.2.1-6.fc32.x86_64 (new) but I 
failed to reproduce with gcc-10.2.1-1.fc32.x86_64 (old, before I upgraded GCC). 
So it's a regression of gcc-10.2.1-6.fc32.x86_64 package.

The package contains multiple downstream patches:

   https://src.fedoraproject.org/rpms/gcc/tree/f32

Commands used to reproduce the issue:

   export MAKEFLAGS=-j10
   ./configure --with-lto 
   make

Extract of my Makefile:

OPT=-DNDEBUG -g -fwrapv -O3 -Wall
BASECFLAGS=  -Wno-unused-result -Wsign-compare
CONFIGURE_CFLAGS_NODIST= -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -fvisibility=hidden
CONFIGURE_LDFLAGS_NODIST= -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g

--

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



[issue42164] Python fails to compile in the Fedora Stable LTO buildbots

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> I have been trying to diagnose this failure:
> https://buildbot.python.org/all/#/builders/271/builds/710/steps/3/logs/stdio

This is the "AMD64 Fedora Stable LTO 3.x" worker. The latest successful build 
was build 684, finished 6 days ago. test.pythoninfo of build 684:

CC.version: gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
platform.libc_ver: glibc 2.31
platform.platform: Linux-5.8.14-200.fc32.x86_64-x86_64-with-glibc2.31
sys.version: 3.10.0a1+ (heads/master:c0f22fb8b3, Oct 21 2020, 00:02:36)  [GCC 
10.2.1 20200723 (Red Hat 10.2.1-1)]
sysconfig[CCSHARED]: -fPIC
sysconfig[CC]: gcc -pthread
sysconfig[CFLAGS]: -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall
sysconfig[OPT]: -DNDEBUG -g -fwrapv -O3 -Wall
sysconfig[PY_CFLAGS]: -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall
sysconfig[PY_CFLAGS_NODIST]: -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal
sysconfig[PY_CORE_LDFLAGS]: -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g
sysconfig[PY_LDFLAGS_NODIST]: -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g
sysconfig[PY_STDMODULE_CFLAGS]: -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O3 -Wall -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none -g -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal 
-I. -I./Include


It started to fail at October 21 (build 685). At 2020-10-21, GCC package was 
upgraded from version 10.2.1-1 to 10.2.1-5 to gcc-10.2.1-5 according to 
/var/log/dnf.log:

2020-10-21T06:58:01-0400 SUBDEBUG drpm: spawned 2243855: /usr/bin/applydeltarpm 
-a x86_64 
/var/cache/dnf/updates-b3cb4614b6495970/packages/gcc-10.2.1-1.fc32_10.2.1-5.fc32.x86_64.drpm
 /var/cache/dnf/updates-b3cb4614b6495970/packages/gcc-10.2.1-5.fc32.x86_64.rpm

Package changelog between 10.2.1-1 and 10.2.1-5:
---
* Mon Oct 05 2020 Jakub Jelinek  10.2.1-5
- update from releases/gcc-10 branch
  - PRs bootstrap/97163, bootstrap/97183, c++/96994, c++/97145, c++/97195,
fortran/93423, fortran/95614, fortran/96041, gcov-profile/64636,
gcov-profile/96913, gcov-profile/97069, gcov-profile/97193,
libstdc++/94160, libstdc++/94681, libstdc++/96803, libstdc++/97101,
libstdc++/97167, middle-end/95464, middle-end/97054, middle-end/97073,
preprocessor/96935, target/71233, target/96683, target/96795,
target/96827, target/97166, target/97184, target/97231, target/97247,
tree-optimization/96979, tree-optimization/97053

* Wed Sep 16 2020 Jakub Jelinek  10.2.1-4
- update from releases/gcc-10 branch
  - PRs bootstrap/96203, c++/95164, c++/96862, c++/96901, d/96157, d/96924,
debug/93865, debug/94235, debug/96729, fortran/94690, fortran/95109,
fortran/95398, fortran/95882, fortran/96859, libstdc++/71960,
libstdc++/92978, libstdc++/96766, libstdc++/96851, lto/94311,
middle-end/87256, middle-end/96369, target/85830, target/94538,
target/96357, target/96551, target/96574, target/96744, target/96808,
target/97028, tree-optimization/88240, tree-optimization/96349,
tree-optimization/96370, tree-optimization/96514,
tree-optimization/96522, tree-optimization/96579,
tree-optimization/96597, tree-optimization/96820,
tree-optimization/96854, tree-optimization/97043
- fix up ARM target attribute/pragma handling (#1875814, PR target/96939)
- don't ICE on sp clobbers with -mincoming-stack-boundary=2 on ia32
  (#1862029, PR target/97032)

* Wed Aug 26 2020 Jakub Jelinek  10.2.1-3
- update from releases/gcc-10 branch
  - PRs c++/95428, c++/96082, c++/96106, c++/96164, c++/96199, c++/96497,
c/96545, c/96549, c/96571, d/96250, d/96254, d/96301, debug/96354,
fortran/93553, fortran/96312, fortran/96486, ipa/95320, ipa/96291,
ipa/96482, libstdc++/89760, libstdc++/95749, libstdc++/96303,
libstdc++/96484, libstdc++/96718, lto/95362, lto/95548,
middle-end/96426, middle-end/96459, target/93897, target/95450,
target/96191, target/96243, target/96446, target/96493, target/96506,
target/96525, target/96530, target/96536, target/96562, target/96682,
tree-optimization/96483, tree-optimization/96535,
tree-optimization/96722, tree-optimization/96730,
tree-optimization/96758
- mangle some further symbols needed for debug info during early dwarf
  (#1862029, PR debug/96690)
- during %check perform tests whether annobin is usable with the newly built
  compiler or whether it might need to be rebuilt
- disable graphite for ELN

* Tue Aug 04 2020 Jakub Jelinek  10.2.1-2
- update from releases/gcc-10 branch
  - PRs c++/955

[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21909
pull_request: https://github.com/python/cpython/pull/22995

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



[issue42161] Remove private _PyLong_Zero and _PyLong_One variables

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8e3b9f92835654943bb59d9658bb52e1b0f40a22 by Victor Stinner in 
branch 'master':
bpo-42161: Add _PyLong_GetZero() and _PyLong_GetOne() (GH-22993)
https://github.com/python/cpython/commit/8e3b9f92835654943bb59d9658bb52e1b0f40a22


--

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


STINNER Victor  added the comment:

> By the way, Unicode 3.2 was released in 2002: 18 years ago. I don't think 
> that it's still relevant in 2020 to keep backward compatibility with Unicode 
> 3.2. I propose to deprecate unicodedata.ucd_3_2_0 and deprecate the 
> unicodedate.UCD type. In Python 3.12, we will be able to remove a lot of 
> code, and simplify the code a lot.

Oh, it is used by the IDNA encoding (encodings.idna module) and the stringprep 
module (which is used by the encodings.idna module.

--

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



[issue42157] Cleanup the unicodedata module

2020-10-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21908
pull_request: https://github.com/python/cpython/pull/22994

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



  1   2   3   4   5   6   7   8   9   10   >