[issue40371] Deadlock in logging.config.dictConfig

2020-04-23 Thread mrc


New submission from mrc :

DataGraham in #django reported a deadlock with a very specific logging 
configuration. Issue is reproducible from this code: 
https://github.com/data-graham/wedge. To trigger the deadlock at least one 
handle must be enable. Note how there there are no loggers using those 
handlers. 
(https://github.com/data-graham/wedge/blob/master/wedge/settings.py#L127-L169)

The two offending locks causing the deadlock are logging._lock and a lock used 
by importlib._bootstrap._imp (_PyImport_AcquireLock).


TH1> start and complete the logging configuration via dictConfig. An handler is 
configured but no logger uses it, only a weakref holds it
TH2> start logging configuration, acquires logging._lock
TH1> import some module, acquiring the import lock
TH1> the garbage collector starts and reclaims the unused handled (only a 
weakref exists)
TH1> the weakref callback tries to acquire logging._lock. WAITING
TH2> start importing some module, try to acquire import lock. DEADLOCK

Attached the traceback of the threads. I could test this with Python3.7 only 
(and Django 3.0).

--
components: Library (Lib)
files: deadlock_logging.log
messages: 367085
nosy: mrc
priority: normal
severity: normal
status: open
title: Deadlock in logging.config.dictConfig
versions: Python 3.7
Added file: https://bugs.python.org/file49088/deadlock_logging.log

___
Python tracker 

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



[issue40372] doctest example programs should exit 1 if any test fails

2020-04-23 Thread Andreas Sommer


New submission from Andreas Sommer :

Documentation recommends calling `doctest.testmod()`, but exits with code 0 
even if a test fails.

--
assignee: docs@python
components: Documentation
messages: 367086
nosy: Andreas Sommer, docs@python
priority: normal
severity: normal
status: open
title: doctest example programs should exit 1 if any test fails
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue40372] doctest example programs should exit 1 if any test fails

2020-04-23 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +18997
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19673

___
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 Antoine Pitrou


Antoine Pitrou  added the comment:

If I believe what Victor wrote about:
"""
The implementation of random.Random, random.SystemRandom and
random.Random subclasses are not affected by this change.
"""

then I don't understand how the API is changed.  IIUC, users subclassing 
random.Random won't see a difference.  However, users now can subclass 
BaseRandom which makes it easier to obtain a full-featured random generator 
class.

However, if we want to think about a new subclassing API, it may be worth 
looking at the recent Numpy changes. Numpy added a new random generator API 
recently, with a design based on composition rather than inheritance (and also 
they switched from Mersenne Twister to another underlying PRNG!):
https://numpy.org/doc/stable/reference/random/index.html

--

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

Ned, the analysis seems correct. We need to fix test_peg_generator so it uses 
the same build options as the interpreter. I am slightly surprised as I was 
under the assumption that distutils propagates the compiler options that were 
used when the interpreter was built automatically

--

___
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


Change by Pablo Galindo Salgado :


--
nosy: +lys.nikolaou

___
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


Change by Pablo Galindo Salgado :


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

___
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, could you check if PR 19674 fixes the issue? That PR ensures that we 
are using the same set of flags as to when building the interpreter, which 
independently of this issue, is the correct thing to do.

I suspect that given the path 
'/home/aixtools/buildarea/3.x.aixtools-aix-power6/build/target/lib/python3.9/config-3.9d/ld_so_aix',
 distutils is triying to use an installed 'ld_so_aix' instead of the one in 
Modules/ld_so_aix.

--

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

New issue with test during PR19764:

0:03:29 [416/423/1] test_peg_generator failed (2 min 34 sec) -- running: 
test_pathlib (3 min 19 sec), test_bufio (3 min 17 sec), test_concurrent_futures 
(3 min 10 sec), test_multiprocessing_fork (3 min), test_subprocess (2 min 49 
sec), test_multiprocessing_forkserver (3 min 18 sec), 
test_multiprocessing_spawn (2 min 56 sec)
[]

\u2514\u2500\u2500Rule
   \u2514\u2500\u2500Rhs
  \u2514\u2500\u2500Alt
 \u251c\u2500\u2500NamedItem
 \u2502  \u2514\u2500\u2500StringLeaf("'a'")
 \u2514\u2500\u2500NamedItem
\u2514\u2500\u2500Opt
   \u2514\u2500\u2500Rhs
  \u2514\u2500\u2500Alt
 \u251c\u2500\u2500NamedItem
 \u2502  \u2514\u2500\u2500StringLeaf("'b'")
 \u2514\u2500\u2500NamedItem
\u2514\u2500\u2500Opt
   \u2514\u2500\u2500Rhs
  \u2514\u2500\u2500Alt
 \u251c\u2500\u2500NamedItem
 \u2502  \u2514\u2500\u2500StringLeaf("'c'")
 \u2514\u2500\u2500NamedItem
\u2514\u2500\u2500Opt
   \u2514\u2500\u2500Rhs
  \u2514\u2500\u2500Alt
 \u2514\u2500\u2500NamedItem

\u2514\u2500\u2500StringLeaf("'d'")

start() ... (looking at 1.0: OP:'(')
  expect('(') ... (looking at 1.0: OP:'(')
  ... expect('(') -> TokenInfo(type=54 (OP), string='(', start=(1, 0), end=(1, 
1), line='(1)')
  expr() ... (looking at 1.1: NUMBER:'1')
number() ... (looking at 1.1: NUMBER:'1')
... number() -> TokenInfo(type=2 (NUMBER), string='1', start=(1, 1), 
end=(1, 2), line='(1)')
  ... expr() -> [TokenInfo(type=2 (NUMBER), string='1', start=(1, 1), end=(1, 
2), line='(1)')]
  expect(')') ... (looking at 1.2: OP:')')
  ... expect(')') -> TokenInfo(type=54 (OP), string=')', start=(1, 2), end=(1, 
3), line='(1)')
... start() -> [TokenInfo(type=54 (OP), string='(', start=(1, 0), end=(1, 1), 
line='(1)'), [TokenInfo(type=2 (NUMBER), string='1', start=(1, 1), end=(1, 2), 
line='(1)')], TokenInfo(type=54 (OP), string=')', start=(1
Rule('start', None, Rhs([Alt([NamedItem(None, Gather(StringLeaf("','"), 
NameLeaf('thing'))), NamedItem(None, NameLeaf('NEWLINE'))])]))
/tmp/tmp9nzhxvu1/parse.c: In function 'start_rule':
/tmp/tmp9nzhxvu1/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/tmp9nzhxvu1/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 *);
 ^~
/tmp/tmp1qne6lpy/parse.c: In function 'start_rule':
/tmp/tmp1qne6lpy/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/tmp1qne6lpy/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 *);
 ^~
test test_peg_generator failed -- multiple errors occurred; run in verbose mode 
for details
0:03:47 [417/423/1] test_pathlib passed (3 min 36 sec) -- running: test_bufio 
(3 min 35 sec), test_concurrent_futures (3 min 27 sec), 
test_multiprocessing_fork (3 min 18 sec), test_subprocess (3 min 6 sec), 
test_multiprocessing_forkserver (3 min 35 sec), test_multiprocessing_spawn (3 
min 14 sec)
0:03:51 [418/423/1] test_multiprocessing_fork passed (3 min 21 sec) -- running: 
test_bufio (3 min 39 sec), test_concurrent_futures (3 min 32 sec), 
test_subprocess (3 min 11 sec), test_multiprocessing_forkserver (3 min 40 sec), 
test_multiprocessing_spawn (3 min 18 sec)
/home/aixtools/python/cpython-master/Lib/multiprocessing/resource_tracker.py:216:
 UserWarning: resource_tracker: There appear to be 1 leaked shared_memory 
objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
/home/aixtools/python/cpython-master/Lib/multiprocessing/resource_tracker.py:229:
 UserWarning: resource_tracker: '/psm_35e4dd20': [Errno 2] No such file or 
directory: '/psm_35e4dd20'
  warnings.warn('reso

[issue40373] urlunparse does not escape slash (/) for http+unix:// in netloc field

2020-04-23 Thread Марк Коренберг

New submission from Марк Коренберг :

urlunsplit(('http+unix', '\x00qwe/asd', 'def', '', '')) 
  

gives:

'http+unix://\x00qwe/asd/def'

but should:

'http+unix://\x00qwe%2Fasd/def'

see https://github.com/msabramo/requests-unixsocket for examples of such URLs.

Workaround: build URL by hand, like `f'http+unix://{quote(..., safe='')}/'`

--
components: Library (Lib)
messages: 367092
nosy: socketpair
priority: normal
severity: normal
status: open
title: urlunparse does not escape slash (/) for http+unix:// in netloc field
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



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

2020-04-23 Thread Michael Felt


Michael Felt  added the comment:

Currently build using xlc-v13 hangs during creation of _json.so. Trying xlc-v11.

--

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

with the xlc-v11 environment yet another issue:

Stop.
/usr/bin/make returned an error
root@x065:[/data/prj/python/python-3.9]make V=1
xlc_r -c   -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -O
-I../git/python-3.9/Include/internal -IObjects -IInclude -IPython -I. 
-I../git/python-3.9/Include -I/opt/include   -DPy_BUILD_CORE -o Modules/_math.o 
../git/python-3.9/Modules/_math.c
 CC='xlc_r' LDSHARED='Modules/ld_so_aix xlc_r -bI:Modules/python.exp' 
OPT='-O'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E 
../git/python-3.9/setup.py  build
make: 1254-059 The signal code from the last command is 11.

** All I can test using PR19674 ** Hope it helps.

--

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

I think the problem here is that distutils in AIX needs the ld_so_aix file 
installed and is not able to use the one in Modules from the source directory. 
This happens because sysconfig has "config-3.9d/ld_so_aix", which does not 
exist until python is installed.

--

___
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 Alex Grönholm

Alex Grönholm  added the comment:

Which PR is it?

--

___
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 1df5a9e88c8df1495a2e689d71b34bf0c7d008ea by Pablo Galindo in 
branch 'master':
bpo-40334: Fix build errors and warnings in test_peg_generator (GH-19672)
https://github.com/python/cpython/commit/1df5a9e88c8df1495a2e689d71b34bf0c7d008ea


--

___
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 Alex Grönholm

Alex Grönholm  added the comment:

Oh, it's https://github.com/python/cpython/pull/19121. I think it would be 
prudent to add a test as well to make sure this doesn't happen again.

--

___
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 Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

I propose skipping test_peg_generator for now, so that we don't hold the alpha6 
release. It actually only tests the generator and not the parser and since we 
don't plan on adding new operators in the very near future, we can skip it and 
fix it after the release.

--

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

Interestingly, test_distutils has the same problem, but basically skips the 
test:

test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase) ... skipped 
"The '/usr/local/lib/python3.9/config-3.9d/ld_so_aix' command is not found"

--

___
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



[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



[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



[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



[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



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



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



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

> 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



[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



[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



[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



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



[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



[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



[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



[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



[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



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



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



[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



[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



[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



[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



[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



[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


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



[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 
(test.test_peg_generator.

[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



[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



[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



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



[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



[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



[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



[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



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



[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



[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



[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



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

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


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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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


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



[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



[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



[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



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



[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



  1   2   >