[issue11654] errors in atexit hooks don't change process exit code

2020-04-23 Thread Glyph Lefkowitz


Glyph Lefkowitz  added the comment:

I hope nobody will mind if I close: It's a duplicate of issue1257 so future 
discussion, if any, should probably happen there.

--
nosy: +glyph
resolution:  -> duplicate
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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah that's why we have a PR out to delete or skip this test. Pablo and
Lysandros will deal with it tomorrow.

On Thu, Apr 23, 2020 at 19:33 STINNER Victor  wrote:

>
> STINNER Victor  added the comment:
>
> test_peg_generator leaks references.
>
> Example with s390x RHEL8 Refleaks 3.x:
> https://buildbot.python.org/all/#builders/536/builds/67
>
> test_peg_generator leaked [24246, 24242, 24246] references, sum=72734
> test_peg_generator leaked [10928, 10926, 10928] memory blocks, sum=32782
>
>
> The following test is enough to trigger a leak:
>
> $ ./python -m test -R 3:3 test_peg_generator -m
> test.test_peg_generator.test_c_parser.TestCParser.test_error_in_rules
>
> 0:00:00 load avg: 0.94 Run tests sequentially
> 0:00:00 load avg: 0.94 [1/1] test_peg_generator
> beginning 6 repetitions
> 123456
> ..
> test_peg_generator leaked [55, 55, 55] references, sum=165
> test_peg_generator leaked [19, 19, 19] memory blocks, sum=57
> test_peg_generator failed
>
> == Tests result: FAILURE ==
>
> 1 test failed:
> test_peg_generator
>
> Total duration: 10.8 sec
> Tests result: FAILURE
>
> --
>
> ___
> Python tracker 
> 
> ___
>
-- 
--Guido (mobile)

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

test_peg_generator leaks references.

Example with s390x RHEL8 Refleaks 3.x:
https://buildbot.python.org/all/#builders/536/builds/67

test_peg_generator leaked [24246, 24242, 24246] references, sum=72734
test_peg_generator leaked [10928, 10926, 10928] memory blocks, sum=32782


The following test is enough to trigger a leak:

$ ./python -m test -R 3:3 test_peg_generator -m 
test.test_peg_generator.test_c_parser.TestCParser.test_error_in_rules

0:00:00 load avg: 0.94 Run tests sequentially
0:00:00 load avg: 0.94 [1/1] test_peg_generator
beginning 6 repetitions
123456
..
test_peg_generator leaked [55, 55, 55] references, sum=165
test_peg_generator leaked [19, 19, 19] memory blocks, sum=57
test_peg_generator failed

== Tests result: FAILURE ==

1 test failed:
test_peg_generator

Total duration: 10.8 sec
Tests result: FAILURE

--

___
Python tracker 

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



[issue39983] test.regrtest: test marked as failed (env changed), but no warning: test_multiprocessing_forkserver

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

test_concurrent_futures "unraisable exception" may be bpo-39995.

--

___
Python tracker 

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



[issue39645] Expand concurrent.futures.Future's public API

2020-04-23 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

___
Python tracker 

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



[issue40048] _PyEval_EvalFrameDefault() doesn't reset tstate->frame if _PyCode_InitOpcache() fails

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the review Pablo ;-)

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



[issue40048] _PyEval_EvalFrameDefault() doesn't reset tstate->frame if _PyCode_InitOpcache() fails

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d9df63deab78f70061a5a24c1f92e6d389fc45f7 by Victor Stinner in 
branch '3.8':
bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691) (GH-19698)
https://github.com/python/cpython/commit/d9df63deab78f70061a5a24c1f92e6d389fc45f7


--

___
Python tracker 

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



[issue39983] test.regrtest: test marked as failed (env changed), but no warning: test_multiprocessing_forkserver

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

Oh nice, my fix worked as expected: "Warning -- Unraisable exception" was 
logged! But the unraisable exception itself was not logged.

https://buildbot.python.org/all/#/builders/612/builds/292

0:04:02 load avg: 8.11 [421/423/1] test_concurrent_futures failed (env changed) 
(3 min 39 sec) -- running: test_peg_generator (2 min 3 sec)
Warning -- Unraisable exception
test_cancel (test.test_concurrent_futures.FutureTests) ... ok
test_cancelled (test.test_concurrent_futures.FutureTests) ... ok
(...)
test_first_exception_some_already_complete 
(test.test_concurrent_futures.ThreadPoolWaitTests) ... ok
test_pending_calls_race (test.test_concurrent_futures.ThreadPoolWaitTests) ... 
ok
test_timeout (test.test_concurrent_futures.ThreadPoolWaitTests) ... ok

--

Ran 193 tests in 219.248s

OK (skipped=6)

--

___
Python tracker 

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



[issue40375] Add the UNSELECT command to imaplib

2020-04-23 Thread Eric V. Smith


New submission from Eric V. Smith :

RFC 3691 from 2004 adds support for the UNSELECT command as an extension 
capability. https://tools.ietf.org/html/rfc3691

imaplib does not support UNSELECT.

--
components: Library (Lib)
messages: 367165
nosy: eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: Add the UNSELECT command to imaplib
type: enhancement
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



[issue40048] _PyEval_EvalFrameDefault() doesn't reset tstate->frame if _PyCode_InitOpcache() fails

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19018
pull_request: https://github.com/python/cpython/pull/19698

___
Python tracker 

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



[issue40048] _PyEval_EvalFrameDefault() doesn't reset tstate->frame if _PyCode_InitOpcache() fails

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 25104949a5a60ff86c10691e184ce2ecb500159b by Victor Stinner in 
branch 'master':
bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691)
https://github.com/python/cpython/commit/25104949a5a60ff86c10691e184ce2ecb500159b


--

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

Copy of the very interesting 
https://svnweb.freebsd.org/ports?view=revision=518640 commit message 
by koobs:


Log Message:

lang/python{27,35,36,37,38}: Add closefrom(2) support

A single close(fd) syscall is cheap, but when MAXFDS (maximum file
descriptor number) is high, the loop calling close(fd) on each file
descriptor can take several milliseconds.

The default value of subprocess.Popen "close_fds" parameter changed to True
in Python 3. Compared to Python 2, close_fds=True can make Popen 10x
slower: see bpo-37790 [1]

The present workaround on FreeBSD to improve performance is to load and
mount the fdescfs kernel module, but this is not enabled by default.

This change adds minimum viable (and upstreamable) closefrom(2) syscall
support to Python's subprocess and posix modules, improving performance
significantly for loads that involve working with many processes, such as
diffoscope, ansible, and many others.

For additional optimizations, upstream recently (3.8) landed posix_spawn(2)
support [3] and has stated that they will adopt close_range(2) after Linux
merges it [4]. Linux/FreeBSD developers are already collaborating on
ensuring compatible implementations, with FreeBSD's implementation pending
in D21627. [5]

Thank you emaste, cem, kevans for providing analysis, input,
clarifications, comms/upstream support and patches.

[1] https://bugs.python.org/issue37790
[2] https://bugs.python.org/issue38061
[3] https://bugs.python.org/issue35537
[4] https://lwn.net/Articles/789023/
[5] https://reviews.freebsd.org/D21627

Additional References:

https://bugs.python.org/issue8052
https://bugs.python.org/issue11284
https://bugs.python.org/issue13788
https://bugs.python.org/issue1663329
https://www.python.org/dev/peps/pep-0446/

PR: 242274, 221700
Submitted by:   kevans (emaste, cem)
Approved by:koobs (python (maintainer), santa)

--

___
Python tracker 

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



[issue1663329] subprocess/popen close_fds perform poor if SC_OPEN_MAX is hi

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


--
resolution: accepted -> fixed

___
Python tracker 

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



[issue37790] subprocess.Popen() is extremely slow (with close_fds=True which is the default) on Illumos

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

> We've moved illumos-gate wsdiff python tool from Python 2 to Python 3.

I guess that you're talking about 
https://github.com/illumos/illumos-gate/blob/master/usr/src/tools/scripts/wsdiff.py

This project is part of illumos: "An open-source Unix operating system". It's a 
fork of Solaris.

Python does not officially support Solaris not Illumos. If someone provides a 
patch, we can review it. But I'm not aware of anyone working actively on 
supporting Illumos.

In the meanwhile, there are two workarounds:

* Use subprocess.Popen(close_fds=False): it should be safe since PEP 446 has 
been implemented in Python 3.4... except for C extension modules and C 
libraries which don't implement it.
* Reduce the maximum number of file descriptors.

On Linux and FreeBSD (if fdescfs kernel module is loaded and mounted), Python 3 
iterates on /proc/self/fd/. On FreeBSD, the closefrom() syscall can be used: PR 
19697. But I'm not aware of any more efficient solution for Illumos.

Since the latest comment of the original poster was last August, I close the 
issue.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
title: subprocess.Popen() is extremely slow -> subprocess.Popen() is extremely 
slow (with close_fds=True which is the default) on Illumos

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

Links to the FreeBSD downstream patches:

* https://reviews.freebsd.org/rP518640
* https://svnweb.freebsd.org/ports?view=revision=518640
* https://svnweb.freebsd.org/ports/head/lang/python38/files/
* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274
* "Patches based on emaste/cem contributions in PR 221700." wrote Kyle Evans in 
the bugzilla issue
* "cem" is Conrad Meyer: https://reviews.freebsd.org/p/cem/
* "emaste" is Ed Maste: https://reviews.freebsd.org/p/emaste/

--

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19017
pull_request: https://github.com/python/cpython/pull/19697

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 50f28dea32c45e1a49b3bd07c874b4fa837a5e88 by Pablo Galindo in 
branch 'master':
bpo-40334: Allow to run make regen-pegen without distutils (GH-19684)
https://github.com/python/cpython/commit/50f28dea32c45e1a49b3bd07c874b4fa837a5e88


--

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +19015
pull_request: https://github.com/python/cpython/pull/19695

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +19014
pull_request: https://github.com/python/cpython/pull/19694

___
Python tracker 

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



[issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

I close this issue.

So far, it seems like the number of incompatible changes in Python 3.9 is 
reasonable. If more incompatible changes should be reverted, I suggest to open 
new issues.

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

I don't see any mention of the PEP 617 in What's New in Python 3.9:
https://docs.python.org/dev/whatsnew/3.9.html

--

___
Python tracker 

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



[issue37421] Some tests leak temporary files

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fd32a0e2ee445dd7156323d216627112e66b0a69 by Victor Stinner in 
branch '3.7':
[3.7] bpo-38546: Backport multiprocessing tests fixes from master (GH-19689)
https://github.com/python/cpython/commit/fd32a0e2ee445dd7156323d216627112e66b0a69


--

___
Python tracker 

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



[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fd32a0e2ee445dd7156323d216627112e66b0a69 by Victor Stinner in 
branch '3.7':
[3.7] bpo-38546: Backport multiprocessing tests fixes from master (GH-19689)
https://github.com/python/cpython/commit/fd32a0e2ee445dd7156323d216627112e66b0a69


--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset bc28805570ae3e8835a5d502ae9ab15c52449f77 by Guido van Rossum in 
branch 'master':
bpo-40334: Use old compiler when compile mode is func_type (GH-19692)
https://github.com/python/cpython/commit/bc28805570ae3e8835a5d502ae9ab15c52449f77


--

___
Python tracker 

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



[issue26543] [EASY] imaplib noop Debug: bytes vs Unicode bug in debug mode

2020-04-23 Thread Sadhana Srinivasan


Change by Sadhana Srinivasan :


--
nosy: +rotuna
nosy_count: 9.0 -> 10.0
pull_requests: +19013
pull_request: https://github.com/python/cpython/pull/19693

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +19012
pull_request: https://github.com/python/cpython/pull/19692

___
Python tracker 

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



[issue39932] test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


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



[issue32759] multiprocessing.Array do not release shared memory

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 857d573257ab150d6bea666354312a5fd284b171 by Victor Stinner in 
branch '3.7':
bpo-39932: Fix multiprocessing test_heap() (GH-19690)
https://github.com/python/cpython/commit/857d573257ab150d6bea666354312a5fd284b171


--
nosy: +vstinner

___
Python tracker 

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



[issue39932] test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 857d573257ab150d6bea666354312a5fd284b171 by Victor Stinner in 
branch '3.7':
bpo-39932: Fix multiprocessing test_heap() (GH-19690)
https://github.com/python/cpython/commit/857d573257ab150d6bea666354312a5fd284b171


--

___
Python tracker 

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



[issue33065] IDLE debugger: failure stepping through module loading

2020-04-23 Thread Timothy Geiser


Timothy Geiser  added the comment:

Looks good when testing both the minimal example and the pgpdump original case.

I added the import at the top, and changed the original line 173 from

value = repr(value)

to

value = reprlib.repr(value)

This is based on lines 160 & 161 in reprlib (we need a Repr instance, but 
reprlib makes it's own for us to use).

I get a nice boring and not-crashy result in the debug window for Locals:

data   b''
self   

Thanks for the fix, Terry!
I shouldn't expect any strange side-effects from this, should I?

--

___
Python tracker 

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



[issue39983] test.regrtest: test marked as failed (env changed), but no warning: test_multiprocessing_forkserver

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3340b2a61b458e7087c8c5fea063b1b45e1a4a07 by Victor Stinner in 
branch '3.8':
bpo-39983: Add test.support.print_warning() (GH-19683) (GH-19687)
https://github.com/python/cpython/commit/3340b2a61b458e7087c8c5fea063b1b45e1a4a07


--

___
Python tracker 

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



[issue40048] _PyEval_EvalFrameDefault() doesn't reset tstate->frame if _PyCode_InitOpcache() fails

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-04-23 Thread Tim Peters


Tim Peters  added the comment:

There is no possible world in which the best answer is "hack gcmodule.c" ;-)

I haven't tried to dig into the details here, but Pablo's approach looked 
spot-on to me:  put the solution near the source of the problem.  The problem 
is specific to a relatively tiny number of objects, and all gc asks is that 
they play by the rules.

--

___
Python tracker 

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



[issue33065] IDLE debugger: failure stepping through module loading

2020-04-23 Thread ppperry


Change by ppperry :


--
nosy:  -ppperry

___
Python tracker 

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



[issue39932] test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19009
pull_request: https://github.com/python/cpython/pull/19689

___
Python tracker 

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



[issue33065] IDLE debugger: failure stepping through module loading

2020-04-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Timothy, can you try editing idlelib.debugger_r, line 173, as suggested above 
and see if it solves the problem?

--

___
Python tracker 

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



[issue40374] collections.abc docs table: Mapping missing __reversed__

2020-04-23 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

> `Mapping.__reversed__` exists

While ``'__reversed__' in dir(Mapping)`` is true, that unfortunately does not 
mean that it is a real callable method:


from collections.abc import Mapping
class Map(Mapping):
def __getitem__(self, x):
if x == 42:
return 17
raise KeyError
def __len__(self, x):
return 1
def __iter__(self):
yield 42

>>> m = Map()
>>> reversed(m)
Traceback (most recent call last):
...
TypeError: 'Map' object is not reversible

In the code for Mapping, ``__reversed__`` is explicitly defined as None [1] so 
that calling ``reversed(custom_mapping)`` doesn't accidentally fall back on the 
sequence protocol, which would mean starting at len(custom_mapping)-1 and 
calling __getitem__ on each index [2], which is certainly not desirable for 
arbitrary mappings.

I don't think there is a reasonable way, given arbitrary implementations of 
__len__, __iter__, and __getitem__, to have a mixin reversed iterator.  If 
someone wants their mapping to have a __reversed__ method, they should define 
it themselves.

[1] https://github.com/python/cpython/blob/master/Lib/_collections_abc.py#L707
[2] 
https://docs.python.org/3/reference/datamodel.html?highlight=__reversed__#object.__reversed__

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue40340] Programming FAQ about "How do I convert a string to a number?" contains a typo

2020-04-23 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 3.0 -> 4.0
pull_requests: +19007
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19688

___
Python tracker 

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-23 Thread Michael Felt

Michael Felt  added the comment:

Thanks for the quick work. I’ll test with xlc as well, as the builds behave 
differently this afternoon. 

Sent from my iPhone

> On 23 Apr 2020, at 16:31, Pablo Galindo Salgado  
> wrote:
> 
> 
> Pablo Galindo Salgado  added the comment:
> 
> Tested on an AIX system:
> 
> [pablo@ibm_machine cpython (master)]$ uname -a
> AIX ibm_machine 1 7 *** powerpc  AIX
> [pablo@ibm1 cpython (master)]$ ./python -m test test_peg_generator
> 0:00:00 Run tests sequentially
> 0:00:00 [1/1] test_peg_generator
> 
> == Tests result: SUCCESS ==
> 
> 1 test OK.
> 
> Total duration: 5.0 sec
> Tests result: SUCCESS
> 
> I will mark this issue as fixed as It was failing before on this machine and 
> now the test suceeds. Feel free to reopen if is not fixes in your system :)
> 
> --
> resolution:  -> fixed
> stage: patch review -> resolved
> status: open -> closed
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39983] test.regrtest: test marked as failed (env changed), but no warning: test_multiprocessing_forkserver

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19006
pull_request: https://github.com/python/cpython/pull/19687

___
Python tracker 

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



[issue40150] (minor) mismatched argument in overlapped_RegisterWaitWithQueue call to RegisterWaitForSingleObject

2020-04-23 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 1.0 -> 2.0
pull_requests: +19005
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19686

___
Python tracker 

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



[issue40346] Add random.BaseRandom to ease implementation of subclasses

2020-04-23 Thread Tim Peters


Tim Peters  added the comment:

>> Making it easy to create subclasses was never a goal regardless.

> It's clearly advertised at the beginning of the documentation:
>
> "Class Random can also be subclassed if you want to use a
> different basic generator of your own devising: (...)"
>
> Do you mean that the documentation is wrong and users must
> not subclass random.Random?

I don't know about the docs, but I do know what the goals were whenever I wrote 
the code ;-)  It _can_ be subclassed - but so can be any class whatsoever.  
There was never an intent to make usefully subclass-ing Random easy:  which is 
precisely what you've discovered and are attempting to improve.

Already said that's fine by me, with caveats.  It's not worth much that I can 
see, beyond scratching an "elegance" itch that I don't happen to have in this 
case.  Who subclasses Random in the real world?  Who would want to?  Python 
wanted to in order to add SystemRandom, and did as little as necessary to do so 
usefully.  A long time ago, I believe we also supplied a subclass to give 
results identical to Python's ancient (& long gone) Wichmann-Hill generator.

Those two are the only cases I've heard of (outside of the test suite).

Provided reworking it doesn't break working code or slow things down, I'm +0.

--

___
Python tracker 

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



[issue40340] Programming FAQ about "How do I convert a string to a number?" contains a typo

2020-04-23 Thread Cajetan Rodrigues


Cajetan Rodrigues  added the comment:

Yes, I think that's acceptable.

--

___
Python tracker 

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



[issue40368] os.path.realpath uppercases Windows drive letter on Python 3.8

2020-04-23 Thread Eryk Sun


Eryk Sun  added the comment:

> `os.path.abspath(".")` returned 
> `'c:\\Users\\Kagami\\Documents\\GitHub\\gecko-dev'`. 
> Should `ntpath.normpaoh` make the drive letter uppercase?

ntpath.abspath and ntpath.normpath should preserve the input case for all 
components of a path because they don't query the system for the real path. On 
the other hand, ntpath.realpath in 3.8+ opens the path and queries the final 
path from the system. 

With drive-relative paths, ntpath.abspath does upper-case the drive letter. 
That's due to the underlying GutFullPathNameW call on Windows (an API function 
that normalizes a path as a string-only operation). We should just leave that 
up to Windows instead of trying to impose consistency. The behavior could be 
documented, however, along with other Windows behaviors such as per-drive 
working directories with drive-relative paths, DOS devices (e.g. 
"C:/Temp/con.txt" -> r"\\.\con") and stripping of trailing dots and spaces 
(e.g. "C:/Temp/spam. . ." -> r"C:\Temp\spam"). These cases make 
ntpath.abspath(path) more complicated than just the documented equivalent of 
ntpath.normpath(ntpath.join(os.getcwd(), path))` on "most platforms" (i.e. most 
POSIX platforms -- not Windows).

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +19004
pull_request: https://github.com/python/cpython/pull/19684

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

"That's for pointing that out" -> "Thanks for pointing that out"

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> oduleNotFoundError: No module named 'distutils.tests'

Oh, are you using a python distribution that strips distutils? Is this Debian 
or Ubuntu?

I suppose we need to account for that. I will create a PR for trying to address 
both. That's for pointing that out, Serhiy!

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It does not work with python3.8 either.

$ make -s regen-all PYTHON_FOR_REGEN=python3.8
./Include/opcode.h.new regenerated from ./Lib/opcode.py
Jump table written into ./Python/opcode_targets.h.new
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpython/Tools/peg_generator/pegen/__main__.py", line 
16, in 
from pegen.build import build_parser_and_generator
  File "/home/serhiy/py/cpython/Tools/peg_generator/pegen/build.py", line 13, 
in 
from distutils.tests.support import fixup_build_ext
ModuleNotFoundError: No module named 'distutils.tests'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in 
apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in 
from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in 
import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in 

from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in 

import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in 
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpython/Tools/peg_generator/pegen/__main__.py", line 
16, in 
from pegen.build import build_parser_and_generator
  File "/home/serhiy/py/cpython/Tools/peg_generator/pegen/build.py", line 13, 
in 
from distutils.tests.support import fixup_build_ext
ModuleNotFoundError: No module named 'distutils.tests'
Makefile:837: recipe for target 'regen-pegen' failed
make: *** [regen-pegen] Error 1

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> ImportError: cannot import name 'Final'

Currently, you need Python3.8+ to do 'make regen-pegen'. We can try to modify 
the module to not use newer features like "Final" so you can use older Pythons.

--

___
Python tracker 

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



[issue40336] Refactor typing._SpecialForm

2020-04-23 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue40336] Refactor typing._SpecialForm

2020-04-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 40ded947f82683f0ed08144599a83d3a1ce719eb by Serhiy Storchaka in 
branch 'master':
bpo-40336: Refactor typing._SpecialForm (GH-19620)
https://github.com/python/cpython/commit/40ded947f82683f0ed08144599a83d3a1ce719eb


--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

$ make -s regen-all
./Include/opcode.h.new regenerated from ./Lib/opcode.py
Jump table written into ./Python/opcode_targets.h.new
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/home/serhiy/py/cpython/Tools/peg_generator/pegen/__main__.py", line 
14, in 
from typing import Final
ImportError: cannot import name 'Final'
Makefile:837: recipe for target 'regen-pegen' failed
make: *** [regen-pegen] Error 1

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

> Warning -- files was modified by test_peg_generator
>   Before: []
>   After:  ['parse_d.cp39-win_amd64.pdb', 'vc140.pdb']

Currently working on this.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

AMD64 Windows10 3.x:
https://buildbot.python.org/all/#builders/129/builds/825

Warning -- files was modified by test_peg_generator
  Before: []
  After:  ['parse_d.cp39-win_amd64.pdb', 'vc140.pdb']

--

___
Python tracker 

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



[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-04-23 Thread Kit Yan Choi


Kit Yan Choi  added the comment:

Thank you for looking into this.
Yes, I agree it makes sense to have assertNoWarns for the same reason.

--

___
Python tracker 

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



[issue39932] test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

The following command fails randomly:

$ ./python -m test test_multiprocessing_fork -R 3:3 -m 
test.test_multiprocessing_fork.WithProcessesTestHeap.test_heap -v

Run 1:

test_multiprocessing_fork leaked [73, 52, 33] references, sum=158
test_multiprocessing_fork leaked [31, 23, 14] memory blocks, sum=68
test_multiprocessing_fork leaked [2, 0, 0] file descriptors, sum=2
test_multiprocessing_fork failed

Run 2:

1 test OK.

Run 6:

test_multiprocessing_fork leaked [0, 2, 0] file descriptors, sum=2
test_multiprocessing_fork failed

--

___
Python tracker 

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



[issue39932] test_multiprocessing_fork leaked [0, 2, 0] file descriptors on aarch64 RHEL8 Refleaks 3.7 buildbot

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

On aarch64 RHEL8 Refleaks 3.7, I managed to reproduce the issue with a single 
test:

./python -m test test_multiprocessing_fork -R 3:3 -m 
test.test_multiprocessing_fork.WithProcessesTestHeap.test_heap -v

--

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


Removed file: 
https://bugs.python.org/file49089/readme.md20629842+super...@users.noreply.github.com

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


--
Removed message: https://bugs.python.org/msg367131

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-04-23 Thread Marcin Wiśniewsk

Marcin Wiśniewsk  added the comment:

>``>#
#7¡0.. ⁵
>⁵&^^}
>7&£_86>>
X.*
>{[》》_`&&■●♤
$£/>}<¡#¤>⁵="⁵

--
nosy: +Marcin Wiśniewsk
versions: +Python 3.6
Added file: 
https://bugs.python.org/file49089/readme.md20629842+super...@users.noreply.github.com

___
Python tracker 

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



[issue39983] test.regrtest: test marked as failed (env changed), but no warning: test_multiprocessing_forkserver

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d663d34685e18588748569468c672763f4c73b3e by Victor Stinner in 
branch 'master':
bpo-39983: Add test.support.print_warning() (GH-19683)
https://github.com/python/cpython/commit/d663d34685e18588748569468c672763f4c73b3e


--

___
Python tracker 

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



[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-04-23 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This makes sense, should assertNoWarns() be added too?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-23 Thread Michael Felt


Michael Felt  added the comment:

More `make test` output:

1 test failed:
test_peg_generator

18 tests skipped:
test_devpoll test_epoll test_gdb test_ioctl test_kqueue
test_msilib test_ossaudiodev test_spwd test_startfile test_tix
test_tk test_ttk_guionly test_unicode_file
test_unicode_file_functions test_winconsoleio test_winreg
test_winsound test_zipfile64
0:05:24
0:05:24 Re-running failed tests in verbose mode
0:05:24 Re-running test_peg_generator in verbose mode
test_advanced_left_recursive 
(test.test_peg_generator.test_c_parser.TestCParser) ... ERROR
test_c_parser (test.test_peg_generator.test_c_parser.TestCParser) ... ERROR
test_cut (test.test_peg_generator.test_c_parser.TestCParser) ... ERROR
test_error_in_rules (test.test_peg_generator.test_c_parser.TestCParser) ... 
ERROR
test_gather (test.test_peg_generator.test_c_parser.TestCParser) ... ERROR
test_gather_action_ast (test.test_peg_generator.test_c_parser.TestCParser) ... 
ERROR
test_headers_and_trailer (test.test_peg_generator.test_c_parser.TestCParser) 
... ok
test_if_stmt_action (test.test_peg_generator.test_c_parser.TestCParser) ... 
ERROR
test_left_recursion (test.test_peg_generator.test_c_parser.TestCParser) ... 
ERROR
test_lookahead (test.test_peg_generator.test_c_parser.TestCParser) ... 
/tmp/tmpte0se473/parse.c: In function 'start_rule':
/tmp/tmpte0se473/parse.c:32:35: warning: passing argument 2 of 
'_PyPegen_lookahead' from incompatible pointer type 
[-Wincompatible-pointer-types]
 _PyPegen_lookahead(1, _PyPegen_name_token, p)
   ^~~
In file included from /tmp/tmpte0se473/parse.c:2:0:
/home/aixtools/python/cpython-master/Parser/pegen/pegen.h:90:5: note: expected 
'void * (*)(Parser *) {aka void * (*)(struct  *)}' but argument is 
of type 'struct _expr * (*)(Parser *) {aka struct _expr * (*)(struct 
 *)}'
 int _PyPegen_lookahead(int, void *(func)(Parser *), Parser *);
 ^~
ERROR
test_mutually_left_recursive 
(test.test_peg_generator.test_c_parser.TestCParser) ... ERROR
test_nasty_mutually_left_recursive 
(test.test_peg_generator.test_c_parser.TestCParser) ... ERROR
test_negative_lookahead (test.test_peg_generator.test_c_parser.TestCParser) ... 
/tmp/tmpyyc57e2e/parse.c: In function 'start_rule':
/tmp/tmpyyc57e2e/parse.c:32:35: warning: passing argument 2 of 
'_PyPegen_lookahead' from incompatible pointer type 
[-Wincompatible-pointer-types]
 _PyPegen_lookahead(0, _PyPegen_name_token, p)
   ^~~
In file included from /tmp/tmpyyc57e2e/parse.c:2:0:
/home/aixtools/python/cpython-master/Parser/pegen/pegen.h:90:5: note: expected 
'void * (*)(Parser *) {aka void * (*)(struct  *)}' but argument is 
of type 'struct _expr * (*)(Parser *) {aka struct _expr * (*)(struct 
 *)}'
 int _PyPegen_lookahead(int, void *(func)(Parser *), Parser *);
 ^~
ERROR
test_pass_stmt_action (test.test_peg_generator.test_c_parser.TestCParser) ... 
ERROR
test_return_stmt_noexpr_action 
(test.test_peg_generator.test_c_parser.TestCParser) ... ERROR
test_same_name_different_types 
(test.test_peg_generator.test_c_parser.TestCParser) ... ERROR
test_syntax_error_for_string 
(test.test_peg_generator.test_c_parser.TestCParser) ... []
ERROR
test_ternary_operator (test.test_peg_generator.test_c_parser.TestCParser) ... 
ERROR
test_with_stmt_with_paren (test.test_peg_generator.test_c_parser.TestCParser) 
... ERROR
test_advance_left_recursion 
(test.test_peg_generator.test_first_sets.TestFirstSets) ... ok
test_alternatives (test.test_peg_generator.test_first_sets.TestFirstSets) ... ok
test_epsilon_production_in_start_rule 
(test.test_peg_generator.test_first_sets.TestFirstSets) ... ok
test_gather (test.test_peg_generator.test_first_sets.TestFirstSets) ... ok
test_left_recursion (test.test_peg_generator.test_first_sets.TestFirstSets) ... 
ok
test_multiple_nullable_rules 
(test.test_peg_generator.test_first_sets.TestFirstSets) ... ok
test_mutual_left_recursion 
(test.test_peg_generator.test_first_sets.TestFirstSets) ... ok
test_nasty_left_recursion 
(test.test_peg_generator.test_first_sets.TestFirstSets) ... ok
test_negative_lookahead (test.test_peg_generator.test_first_sets.TestFirstSets) 
... ok
test_nullable_rule (test.test_peg_generator.test_first_sets.TestFirstSets) ... 
ok
test_optional_after (test.test_peg_generator.test_first_sets.TestFirstSets) ... 
ok
test_optional_before (test.test_peg_generator.test_first_sets.TestFirstSets) 
... ok
test_optional_literal (test.test_peg_generator.test_first_sets.TestFirstSets) 
... ok
test_optional_operator (test.test_peg_generator.test_first_sets.TestFirstSets) 
... ok
test_optionals (test.test_peg_generator.test_first_sets.TestFirstSets) ... ok
test_positive_lookahead (test.test_peg_generator.test_first_sets.TestFirstSets) 
... ok
test_repeat_0 (test.test_peg_generator.test_first_sets.TestFirstSets) ... ok
test_repeat_0_with_group 

[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution:  -> rejected
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



[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-04-23 Thread François Freitag

Change by François Freitag :


--
nosy: +francois.freitag

___
Python tracker 

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



[issue39983] test.regrtest: test marked as failed (env changed), but no warning: test_multiprocessing_forkserver

2020-04-23 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

Just for the record,

https://github.com/python/cpython/pull/19677#discussion_r413894982

guido left an opinion that the caching approach might be more proper.
So I 'd like to suggest open a new issue for caching. :)

--

___
Python tracker 

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



[issue26317] Build Problem with GCC + Macintosh OS X 10.11 El Capitain

2020-04-23 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue40374] collections.abc docs table: Mapping missing __reversed__

2020-04-23 Thread Thor Whalen


New submission from Thor Whalen :

`Mapping.__reversed__` exists, but is not listed in the table: 
https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes

https://github.com/python/cpython/blob/master/Doc/library/collections.abc.rst

--
assignee: docs@python
components: Documentation
messages: 367127
nosy: Thor Whalen2, docs@python, rhettinger, stutzbach
priority: normal
pull_requests: 19001
severity: normal
status: open
title: collections.abc docs table: Mapping missing __reversed__
versions: Python 3.8

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ebebb6429c224c713e1c63a0b05d4840f52c7415 by Lysandros Nikolaou in 
branch 'master':
bpo-40334: Improve various PEG-Parser related stuff (GH-19669)
https://github.com/python/cpython/commit/ebebb6429c224c713e1c63a0b05d4840f52c7415


--

___
Python tracker 

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



[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

> I do not think it is right. Please wait, I'll submit an alternate solution.

What is your idea? How would it be different than PR 19414? Refleak buildbots 
are broken for almost one month (bpo-40149), it would be nice to get a fix 
soon. In Python 3.9.0a6 if possible.

--

___
Python tracker 

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



[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

There are limited options to fix this issue:

(A) Revert commit 364f0b0f19cc3f0d5e63f571ec9163cf41c62958

It would reintroduced bpo-35810 bug. Moreover, C extension modules which have 
been modified to call Py_DECREF(Py_TYPE(self)) in tp_dealloc which suddenly 
crash.

I don't think that anyone wants this option.


(B) Require all C extension modules authors to modify their tp_traverse 
function.

It requires to communicate well that all C extension modules which use 
PyType_FromSpec() need to modify their tp_traverse method to add code specific 
to Python 3.8 or newer.

Serhiy and me are against this option.


(C) Modify gcmodule.c to traverse the type.

This option is not trivial since *subtype* are already traversed. Moreover, 
Pablo and Tim are strongly against this option.


(D) Modify PyType_FromSpec() to hook into tp_traverse and transparently visit 
the type, as already done for subtypes.

Option chosen by PR 19414.

Honestly, I'm unhappy that we have to hook into tp_traverse, but this option 
sounds like the least bad option to me.

Developers don't have to modify their C extensions code, the bug is fixed.

--

___
Python tracker 

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



[issue40368] os.path.realpath uppercases Windows drive letter on Python 3.8

2020-04-23 Thread Kagami Sascha Rosylight


Kagami Sascha Rosylight  added the comment:

Should `ntpath.normpath` make the drive letter uppercase?

--

___
Python tracker 

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



[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-04-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not think it is right. Please wait, I'll submit an alternate solution.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I don't know. It's just that I spotted this compiler warnining while 
> reviewing recent buildbot failures.

Given that is a compiler warning and we didn't change those lines, I would say 
is not related to this PR :)

--

___
Python tracker 

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



[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

Tests should be added, maybe based on msg365963 examples. But I would prefer to 
get this bug fixed in 3.9.0a6 (if possible), tests can be added later.

--

___
Python tracker 

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



[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not comfortable with requesting authors of all C extensions to modify their 
tp_traverse function. As Pablo explained, the type is already visited on 
subtypes instances. I approved PR 19414.

--

___
Python tracker 

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



[issue40368] os.path.realpath uppercases Windows drive letter on Python 3.8

2020-04-23 Thread Kagami Sascha Rosylight


Kagami Sascha Rosylight  added the comment:

I mentioned `os.path.abspath` because `os.path.abspath(".")` on console 
returned `'c:\\Users\\Kagami\\Documents\\GitHub\\gecko-dev'`. It seems this 
incompatibility is partially because MSYS shell prefers lowercase letter for 
Windows path while Windows prefers otherwise.

--

___
Python tracker 

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



[issue40359] email.parse part.get_filename() fails to unwrap long attachment file names (legacy API)

2020-04-23 Thread R. David Murray


R. David Murray  added the comment:

Yeah, that looks like a bug in the old API.  If you try the new API, it does 
the right thing.  To do that, import email.policy and make your 
message_as_string call:

  email.message_from_string(raw, policy=email.policy.default)

Note, however, that you really ought to be using message_from_bytes.  
Serialized email messages are bytes, not unicode, and using message_from_string 
will get you in to other trouble.

I don't know if it is worth fixing the old API.

--
title: email.parse part.get_filename() fails to unwrap long attachment file 
names -> email.parse part.get_filename() fails to unwrap long attachment file 
names (legacy API)

___
Python tracker 

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Tested on an AIX system:

[pablo@ibm_machine cpython (master)]$ uname -a
AIX ibm_machine 1 7 *** powerpc  AIX
[pablo@ibm1 cpython (master)]$ ./python -m test test_peg_generator
0:00:00 Run tests sequentially
0:00:00 [1/1] test_peg_generator

== Tests result: SUCCESS ==

1 test OK.

Total duration: 5.0 sec
Tests result: SUCCESS

I will mark this issue as fixed as It was failing before on this machine and 
now the test suceeds. Feel free to reopen if is not fixes in your system :)

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

> Is this related to this issue? We didn't change that line

I don't know. It's just that I spotted this compiler warnining while reviewing 
recent buildbot failures.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

> Is this related to this issue? We didn't change that line

I can provide you access to the buildbot if you'd like to debug the issue.

--
nosy: +cstratak

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> GCC warning on aarch64 Fedora Rawhide LTO + PGO 3.x buildbot:

Is this related to this issue? We didn't change that line

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread STINNER Victor

STINNER Victor  added the comment:

GCC warning on aarch64 Fedora Rawhide LTO + PGO 3.x buildbot:
https://buildbot.python.org/all/#/builders/612/builds/286

In function ‘assemble_lnotab’,
inlined from ‘assemble_emit’ at Python/compile.c:5709:25,
inlined from ‘assemble’ at Python/compile.c:6048:18:
Python/compile.c:5663:19: warning: writing 1 byte into a region of size 0 
[-Wstringop-overflow=]
 5663 | *lnotab++ = k;
  | ~~^~~

--

___
Python tracker 

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9e6a1312c1cd04ab37cddd8f3bb9baa7e9a38bc0 by Pablo Galindo in 
branch 'master':
bpo-40370: Use the same compile and link args as the interpreter used in 
test_peg_generator (GH-19674)
https://github.com/python/cpython/commit/9e6a1312c1cd04ab37cddd8f3bb9baa7e9a38bc0


--

___
Python tracker 

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Michael, can you check if AIX is happy with the current master? :)

--

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

> And how much faster has your example become?

For function declaration, 5% enhancement,
the function call does not show difference because the GenericAlias is not big 
portion on calling.

++++
| Benchmark  | master-generic-alias-1 | bpo-40369-generic-alias-1  |
++++
| bench GenericAlias | 420 ns | 399 ns: 1.05x faster (-5%) |
++++

--

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

And how much faster has your example become?

--

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Dong-hee Na

Dong-hee Na  added the comment:

> Do you have any realistic example which would benefit from speeding up the 
> creation of GenericAlias instances?

Hmm I did not find loop tightly calling case, but
for example, this kinds of usage are very often.

def create_q(l: list[int]) -> Queue[int]:
q = Queue[int]()
for e in l:
q.put(e)
return q

a = create_q([1,2,3,4,5])

In this code, GenericAlias is called 2 times for function declare and function 
call.

It's true that GenericAlias ​​has a small portion in this scenario,
but wouldn't it be worth it if we could optimize itself to a few lines of code?

--

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue17519] unittest should not try to run abstract classes

2020-04-23 Thread Nathaniel Manista


Change by Nathaniel Manista :


--
nosy: +Nathaniel Manista

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have doubts that GenericAlias instances are created in mass in tight loops. 
Do you have any realistic example which would benefit from speeding up creation 
of GenericAlias instances?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 8d1cbfffea7a5dbf7a3c60b066a2c2120ef08cd0 by Lysandros Nikolaou in 
branch 'master':
bpo-40334: Suppress all output in test_peg_generator (GH-19675)
https://github.com/python/cpython/commit/8d1cbfffea7a5dbf7a3c60b066a2c2120ef08cd0


--

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

> Can you propose a PR, so I can have a look at the implementation?

Got it :), I will upload it soon.

--

___
Python tracker 

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



[issue40369] Use PEP 590 vectorcall to speed up GenericAlias.

2020-04-23 Thread STINNER Victor


STINNER Victor  added the comment:

> if the suggestion is accepted, I 'd like to summit the patch :)

Can you propose a PR, so I can have a look at the implementation?

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-04-23 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +18999
pull_request: https://github.com/python/cpython/pull/19675

___
Python tracker 

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

We need to do the same thing as test_build_ext does:

https://github.com/python/cpython/blob/master/Lib/distutils/tests/test_build_ext.py#L56-L58

--

___
Python tracker 

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



[issue40370] AIX: ld_so_aix not found during test of test_peg_generator

2020-04-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> so that we don't hold the alpha6 release.

AIX is not a STABLE buildbot so I cannot hold the release

--

___
Python tracker 

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



  1   2   >