[issue42557] Make asyncio.__main__ reusable, also adding a preamble feature.

2021-01-02 Thread Berry Schoenmakers


Change by Berry Schoenmakers :


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

___
Python tracker 

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



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2021-01-02 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +22890
pull_request: https://github.com/python/cpython/pull/24056

___
Python tracker 

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



[issue42425] Possible leak in initialization of errmap for OSError

2021-01-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +22891
pull_request: https://github.com/python/cpython/pull/24057

___
Python tracker 

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



[issue42808] Add PyType_Type.tp_vectorcall for type(obj) performance

2021-01-02 Thread Dennis Sweeney


New submission from Dennis Sweeney :

# common case
.\python.bat -m pyperf timeit "type(17)"
Master: 49.9 ns +- 1.8 ns ---> PR: 33.3 ns +- 1.4 ns

# uncommon case
.\python.bat -m pyperf timeit "type('A', (object, ), {})"
Master: 5.14 us +- 0.04 us ---> PR: 5.43 us +- 0.06 us

--
components: Interpreter Core
messages: 384218
nosy: Dennis Sweeney
priority: normal
severity: normal
status: open
title: Add PyType_Type.tp_vectorcall for type(obj) performance
type: performance
versions: Python 3.10

___
Python tracker 

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



[issue42808] Add PyType_Type.tp_vectorcall for type(obj) performance

2021-01-02 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2021-01-02 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +22893
pull_request: https://github.com/python/cpython/pull/24059

___
Python tracker 

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



[issue42425] Possible leak in initialization of errmap for OSError

2021-01-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7695d832565914efcedcc885feb129f5102aec90 by Serhiy Storchaka in 
branch '3.9':
[3.9] bpo-42425: Fix possible leak in initialization of errmap for OSError 
(GH-23446). (GH-24057)
https://github.com/python/cpython/commit/7695d832565914efcedcc885feb129f5102aec90


--

___
Python tracker 

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



[issue42808] Add PyType_Type.tp_vectorcall for type(obj) performance

2021-01-02 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42809] Improve pickle tests for recursive data

2021-01-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +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



[issue42809] Improve pickle tests for recursive data

2021-01-02 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR extends tests for pickling recursive structures. The code is 
now more generic and covers more corner cases (found during work on issue36694).

--
components: Tests
messages: 384220
nosy: alexandre.vassalotti, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve pickle tests for recursive data
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue42809] Improve pickle tests for recursive data

2021-01-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue42425] Possible leak in initialization of errmap for OSError

2021-01-02 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



[issue4643] cgitb.html fails if getattr call raises exception

2021-01-02 Thread karl


karl  added the comment:

> The getattr call here has a default value, so it should not raise 
> AttributeError. It should also not raise any other exception because a valid 
> implementation of __getattr__ should raise only AttributeError:


but probably the intent of the patch here is to surface a meaningful error with 
regards to the script, more than an error on the cgitb python lib itself as 
this is a traceback tool. A bit like an HTML validator which continue to 
process things to give some kind of meaning.

Diving into previous issues about scanvars
https://bugs.python.org/issue966992

Similar
https://bugs.python.org/issue1047397 The last comment is basically this issue 
here. 

There is a patch which is lot better for this bug and which addresses the 
issues here. 
https://github.com/python/cpython/pull/15094

It has not been merged yet. Not sure why or if there is anything missing. 

Probably this bug could be closed as a duplicate of 
https://bugs.python.org/issue966992


And someone needs to push to push the latest bits for 
https://github.com/python/cpython/pull/15094


What do you think @iritkatriel ?

I will close my PR.

--

___
Python tracker 

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



[issue40059] Provide a toml module in the standard library

2021-01-02 Thread Matej Cepl


Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue42810] Nested if/else gets phantom else trace (3.10)

2021-01-02 Thread Ned Batchelder


New submission from Ned Batchelder :

(Using CPython commit 6b1ac809b9)

This program never executes line 6, but tracing it claims that it does:

a = b = x = y = z = 1
if a == 1:
if b == 1:
x = 4
else:
y = 6
else:
z = 8
assert (a, b, x, y, z) == (1, 1, 4, 1, 1)

Using a simple trace program 
(https://github.com/nedbat/coveragepy/blob/master/lab/run_trace.py), it 
produces this output:

call  1 @-1
line  1 @0
line  2 @20
line  3 @28
line  4 @36
line  6 @40
line  9 @52
return  9 @76

--
components: Interpreter Core
messages: 384222
nosy: Mark.Shannon, nedbat
priority: normal
severity: normal
status: open
title: Nested if/else gets phantom else trace (3.10)
versions: Python 3.10

___
Python tracker 

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



[issue42803] Traced line number is wrong for "if not __debug__"

2021-01-02 Thread Ned Batchelder


Ned Batchelder  added the comment:

This might be the same problem as #42810.

--

___
Python tracker 

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



[issue42810] Nested if/else gets phantom else trace (3.10)

2021-01-02 Thread Ned Batchelder


Ned Batchelder  added the comment:

This might be the same problem as #42803.

--

___
Python tracker 

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



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

2021-01-02 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2021-01-02 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

https://github.com/python/cpython/pull/23140 merged. Thanks for the patch, 
Kurochan.

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



[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2021-01-02 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Note: I did not request a backport, since this really is a new feature.

--

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2021-01-02 Thread miss-islington


miss-islington  added the comment:


New changeset 49cd68fb1ed4cbaf109308c0a7c8c1efcf6f3775 by Ken Jin in branch 
'master':
bpo-42195: Disallow isinstance/issubclass for subclasses of genericaliases in 
Union (GH-24059)
https://github.com/python/cpython/commit/49cd68fb1ed4cbaf109308c0a7c8c1efcf6f3775


--

___
Python tracker 

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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2021-01-02 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 75bf107c62fbdc00af51ee4f6ab69df4bd201104 by Erlend Egeberg 
Aasland in branch 'master':
bpo-40077: Convert arraymodule to use heap types and establish module state 
(GH-23124)
https://github.com/python/cpython/commit/75bf107c62fbdc00af51ee4f6ab69df4bd201104


--
nosy: +petr.viktorin

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-02 Thread Anthony Sottile


Anthony Sottile  added the comment:

by the way, here's a much smaller case which has a similar problem

```
x = (
f" {test(t)}"
)
```

--

___
Python tracker 

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



[issue42809] Improve pickle tests for recursive data

2021-01-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a25011be8c6f62cb903befe6295d57f0bd30 by Serhiy Storchaka in 
branch 'master':
bpo-42809: Improve pickle tests for recursive data. (GH-24060)
https://github.com/python/cpython/commit/a25011be8c6f62cb903befe6295d57f0bd30


--

___
Python tracker 

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



[issue42809] Improve pickle tests for recursive data

2021-01-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +22896
pull_request: https://github.com/python/cpython/pull/24062

___
Python tracker 

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



[issue42809] Improve pickle tests for recursive data

2021-01-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22897
pull_request: https://github.com/python/cpython/pull/24063

___
Python tracker 

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



[issue42789] Do not skip test_curses on non-tty

2021-01-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 607501abb488fb37e33cf9d35260ab7baefa192f by Serhiy Storchaka in 
branch 'master':
bpo-42789: Don't skip curses tests on non-tty. (GH-24009)
https://github.com/python/cpython/commit/607501abb488fb37e33cf9d35260ab7baefa192f


--

___
Python tracker 

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



[issue42803] Traced line number is wrong for "if not __debug__"

2021-01-02 Thread Ned Batchelder


Ned Batchelder  added the comment:

I think I am finding more examples of the same problem, so I will just add it 
here:

x = "hello"
try:
3/0
except ZeroDivisionError:
if x == 'raise':
raise ValueError()   # line 6
f = 7

This shows a trace for line 6, which is never excecuted:

call  1 @-1
line  1 @0
line  2 @4
line  3 @6
exception  3 @10
line  4 @24
line  5 @36
line  6 @50
line  7 @52
return  7 @58

--

___
Python tracker 

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



[issue42809] Improve pickle tests for recursive data

2021-01-02 Thread miss-islington


miss-islington  added the comment:


New changeset 2e8b1c9e9b2d2e011bf35f77cd611843bac7f3dd by Miss Islington (bot) 
in branch '3.8':
bpo-42809: Improve pickle tests for recursive data. (GH-24060)
https://github.com/python/cpython/commit/2e8b1c9e9b2d2e011bf35f77cd611843bac7f3dd


--

___
Python tracker 

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



[issue42809] Improve pickle tests for recursive data

2021-01-02 Thread miss-islington


miss-islington  added the comment:


New changeset 39a7578186d2f5eaa112a5854c46f84eae401522 by Miss Islington (bot) 
in branch '3.9':
bpo-42809: Improve pickle tests for recursive data. (GH-24060)
https://github.com/python/cpython/commit/39a7578186d2f5eaa112a5854c46f84eae401522


--

___
Python tracker 

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



[issue42772] randrange() mishandles step when stop is None

2021-01-02 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 768fa145cfec2a0599802b74fc31d2bc2812ed96 by Raymond Hettinger in 
branch 'master':
bpo-42772: Step argument ignored when stop is None. (GH-24018)
https://github.com/python/cpython/commit/768fa145cfec2a0599802b74fc31d2bc2812ed96


--

___
Python tracker 

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



[issue42772] randrange() mishandles step when stop is None

2021-01-02 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2021-01-02 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Should Modules/_testcapimodule.c stay untouched?

--

___
Python tracker 

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



[issue4643] cgitb.html fails if getattr call raises exception

2021-01-02 Thread Irit Katriel


Irit Katriel  added the comment:

I agree that this can be closed as duplicate. Thanks, Karl, for the research.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> cgitb failures

___
Python tracker 

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



[issue42811] Update docs for importlib.util.resolve_name() to use __spec__ instead of __package__

2021-01-02 Thread Brett Cannon


New submission from Brett Cannon :

Since importlib now prefers `__spec__` over `__package__`, 
https://docs.python.org/3/library/importlib.html#importlib.util.resolve_name 
should be updated to use `__spec__.parent` instead in the. example.

--
assignee: brett.cannon
components: Documentation
keywords: easy
messages: 384238
nosy: brett.cannon
priority: low
severity: normal
stage: needs patch
status: open
title: Update docs for importlib.util.resolve_name() to use __spec__ instead of 
__package__
versions: Python 3.10

___
Python tracker 

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



[issue40059] Provide a toml module in the standard library

2021-01-02 Thread Brett Cannon


Change by Brett Cannon :


--
versions:  -Python 3.10, Python 3.9

___
Python tracker 

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



[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2021-01-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Tests test_zip_pickle_stability and test_zip_pickle_strict_stability look 
excessively strict. Why did we need them if there are other pickle tests? They 
prevent implementing optimizations like in issue36694.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42810] Nested if/else gets phantom else trace (3.10)

2021-01-02 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Confirmed.  This regression happened between 3.10 alpha 2 and today's build:

$ python3.10 --version
Python 3.10.0a2
$ python3.10 -m trace --trace tmp19.py
 --- modulename: tmp19, funcname: 
tmp19.py(1): a = b = x = y = z = 1
tmp19.py(2): if a == 1:
tmp19.py(3): if b == 1:
tmp19.py(4): x = 4
tmp19.py(9): assert (a, b, x, y, z) == (1, 1, 4, 1, 1)

$ py --version
Python 3.10.0a3+
$ py -m trace --trace tmp19.py
 --- modulename: tmp19, funcname: 
tmp19.py(1): a = b = x = y = z = 1
tmp19.py(2): if a == 1:
tmp19.py(3): if b == 1:
tmp19.py(4): x = 4
tmp19.py(6): y = 6
tmp19.py(9): assert (a, b, x, y, z) == (1, 1, 4, 1, 1)

--
nosy: +pablogsal, rhettinger
priority: normal -> high

___
Python tracker 

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



[issue42789] Do not skip test_curses on non-tty

2021-01-02 Thread STINNER Victor


STINNER Victor  added the comment:

Buildbot failure: ARM Raspbian 3.x:
https://buildbot.python.org/all/#/builders/424/builds/658

Tests are run with env var TERM=screen.xterm-256color.

==
ERROR: test_colors_funcs (test.test_curses.TestCurses)
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_curses.py", 
line 316, in test_colors_funcs
curses.pair_content(curses.COLOR_PAIRS - 1)
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

--
nosy: +vstinner

___
Python tracker 

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



[issue42789] Do not skip test_curses on non-tty

2021-01-02 Thread STINNER Victor


STINNER Victor  added the comment:

s390x RHEL8 3.x:
https://buildbot.python.org/all/#/builders/509/builds/601

Tests run with TERM=xterm-256color.

==
ERROR: test_colors_funcs (test.test_curses.TestCurses)
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z/build/Lib/test/test_curses.py",
 line 316, in test_colors_funcs
curses.pair_content(curses.COLOR_PAIRS - 1)
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1)

--

test.pythoninfo doesn't log anything about curses. I expected to find 
_curses.ncurses_version there.

--

___
Python tracker 

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



[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2021-01-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue42557] Make asyncio.__main__ reusable, also adding a preamble feature.

2021-01-02 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2021-01-02 Thread Guido van Rossum


Guido van Rossum  added the comment:

That's fair.  How do other builtins validate their pickling implementation?

Since the pickling goes through __reduce__/__reduce_ex__ we could instead test 
that those methods return the expected results, that pickling roundtrips, and 
that unpickling those exact byte strings produces the expected value?

--

___
Python tracker 

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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2021-01-02 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +22898
pull_request: https://github.com/python/cpython/pull/24065

___
Python tracker 

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



[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2021-01-02 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:


New changeset 2ea320553298038bb7d6789e50e199332f66 by Lysandros Nikolaou in 
branch 'master':
bpo-40631: Disallow single parenthesized star target (GH-24027)
https://github.com/python/cpython/commit/2ea320553298038bb7d6789e50e199332f66


--

___
Python tracker 

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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2021-01-02 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +22899
pull_request: https://github.com/python/cpython/pull/24066

___
Python tracker 

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



[issue41374] socket.TCP_* no longer available with cygwin 3.1.6+

2021-01-02 Thread Marco Atzeri


Marco Atzeri  added the comment:

The Analysis is correct. 
Removing the test for CYGWIN and always include the 


solved the problem building all python (3.6,3.7,3.8) packages

https://sourceware.org/pipermail/cygwin-apps/2020-December/040845.html
https://sourceware.org/pipermail/cygwin-announce/2020-December/009853.html

attached patch used on the build.
Similar one was applied to the rebuild of 2.7.18

--
nosy: +matzeri
versions: +Python 3.6, Python 3.7
Added file: https://bugs.python.org/file49717/3.6.12-socketmodule.patch

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-02 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Seems that I also found this weird behaviour in the old parser:

import ast
code = """\
x = (
'PERL_MM_OPT', (
f'wat'
f'INSTALL-BASE={shlex.quote(venv)} '
f'wat'
),
)
"""
elem = ast.parse(code).body[0].value.elts[1].values[1].value
print(elem)
print(code.split("\n")[elem.lineno-1][elem.col_offset:elem.end_col_offset])

In Python3.8 this prints:

<_ast.Call object at 0x7f7484393a00>
'wat'

which is wrong as the code for that call is certainly not "wat". This happens 
in the oldparser in 3.9:

❯ ../3.9/python -Xoldparser lel.py

'wat'

And something wrong happens in the current master with the new parser:

❯ ../3.9/python lel.py

STALL-BASE={shlex

But with PR24067:


shlex.quote(venv)

--

___
Python tracker 

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



[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2021-01-02 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +22901
pull_request: https://github.com/python/cpython/pull/24068

___
Python tracker 

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



[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2021-01-02 Thread miss-islington


miss-islington  added the comment:


New changeset 9a608ac17c284008d3c2986a4a8b194f84488e56 by Lysandros Nikolaou in 
branch '3.9':
[3.9] bpo-40631: Disallow single parenthesized star target (GH-24027) (GH-24068)
https://github.com/python/cpython/commit/9a608ac17c284008d3c2986a4a8b194f84488e56


--
nosy: +miss-islington

___
Python tracker 

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



[issue15106] Potential Bug in errors.c

2021-01-02 Thread Irit Katriel


Irit Katriel  added the comment:

The code is not really cloned - note that PyErr_Restore is operating on 
tstate->curexc (the exception currently being handled) while PyErr_SetExcInfo 
is operating on tstate->exc_info (the earliest exception currently on the 
exception stack).

If there is a bug here, I think it is the silent conversion of traceback to 
NULL in the case where it is neither NULL nor Py_None. (The case in 
PyErr_Restore that the comment says should not happen).

Otherwise, the difference is that PyErr_Restore transforms Py_None to NULL for 
the traceback, and PyErr_SetExcInfo doesn't.  That conversion seems neither 
necessary nor wrong.

--
nosy: +iritkatriel
versions: +Python 3.10 -Python 3.4

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset bd2728b1e8a99ba8f8c2d481f88aeb99b8b8360f by Pablo Galindo in 
branch 'master':
bpo-42806: Fix ast locations of f-strings inside parentheses (GH-24067)
https://github.com/python/cpython/commit/bd2728b1e8a99ba8f8c2d481f88aeb99b8b8360f


--

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +22902
pull_request: https://github.com/python/cpython/pull/24069

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset bfc413ce4fa37ccb889757388102c7755e057bf5 by Pablo Galindo in 
branch '3.9':
[3.9] bpo-42806: Fix ast locations of f-strings inside parentheses (GH-24067) 
(GH-24069)
https://github.com/python/cpython/commit/bfc413ce4fa37ccb889757388102c7755e057bf5


--

___
Python tracker 

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



[issue15106] Potential Bug in errors.c

2021-01-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Adding extra checks to PyErr_SetExcInfo doesn't have a lot of value because is 
already out of of contract. If you pass an invalid object (let's say a list) to 
any of the specific APIs (like PyDict_GetItem) it will crash anyway. We could 
add some assert, though.

--
nosy: +pablogsal

___
Python tracker 

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



[issue40631] PEG Parser: Cannot used starred expression in parenthesised expr

2021-01-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue15106] Potential Bug in errors.c

2021-01-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue42810] Nested if/else gets phantom else trace (3.10)

2021-01-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Bisecting points at this commit as the culprit:

28b75c80dcc1e17ed3ac1c69362bf8dc164b760a is the first bad commit
commit 28b75c80dcc1e17ed3ac1c69362bf8dc164b760a
Author: Mark Shannon 
Date:   Wed Dec 23 11:43:10 2020 +

bpo-42246: Don't eliminate jumps to jumps, if it will break PEP 626. 
(GH-23896)

 Lib/test/test_dis.py   |  169 +-
 Lib/test/test_sys_settrace.py  |   64 +
 .../2020-12-22-20-30-11.bpo-42246.7BrPLg.rst   |1 +
 Python/compile.c   |  135 +-
 Python/importlib.h | 1531 +++---
 Python/importlib_external.h| 4884 ++--
 Python/importlib_zipimport.h   | 1796 +++
 7 files changed, 4341 insertions(+), 4239 deletions(-)
 create mode 100644 Misc/NEWS.d/next/Core and 
Builtins/2020-12-22-20-30-11.bpo-42246.7BrPLg.rst
bisect run success

--

___
Python tracker 

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



[issue42810] Nested if/else gets phantom else trace (3.10)

2021-01-02 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

There is something wrong elsewhere as well because even if reverting that 
commit fix the problem:

❯ git reset --hard upstream/master
HEAD is now at bd2728b1e8 bpo-42806: Fix ast locations of f-strings inside 
parentheses (GH-24067)

~/github/python/master master*
❯ git revert 28b75c80dcc1e17ed3ac1c69362bf8dc164b760a
Removing Misc/NEWS.d/next/Core and 
Builtins/2020-12-22-20-30-11.bpo-42246.7BrPLg.rst
mak[master 444e7e11a8] Revert "bpo-42246: Don't eliminate jumps to jumps, if it 
will break PEP 626. (GH-23896)"
 7 files changed, 4605 insertions(+), 4707 deletions(-)
 delete mode 100644 Misc/NEWS.d/next/Core and 
Builtins/2020-12-22-20-30-11.bpo-42246.7BrPLg.rst
 rewrite Python/importlib_external.h (87%)
 rewrite Python/importlib_zipimport.h (85%)
e
~/github/python/master master* ⇡
❯ make -j -s
 CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-g -Og -Wall'   
_TCLTK_INCLUDES='' _TCLTK_LIBS=''   ./python -E ./setup.py -q build

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  pwd   time


~/github/python/master master* ⇡
❯ ./python -m trace --trace ./lel.py
 --- modulename: lel, funcname: 
lel.py(1): a = b = x = y = z = 1
lel.py(2): if a == 1:
lel.py(3): if b == 1:
lel.py(4): x = 4
lel.py(9): assert (a, b, x, y, z) == (1, 1, 4, 1, 1)

Not running the optimize_basic_block function:

diff --git a/Python/compile.c b/Python/compile.c
index 6698b55000..30a0305ef1 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -6074,6 +6074,7 @@ fold_tuple_on_constants(struct instr *inst,
 static int
 optimize_basic_block(basicblock *bb, PyObject *consts)
 {
+return 0;
 assert(PyList_CheckExact(consts));
 struct instr nop;
 nop.i_opcode = NOP;

makes the problem appear again:

❯ make -j -s
 CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-g -Og -Wall'   
_TCLTK_INCLUDES='' _TCLTK_LIBS=''   ./python -E ./setup.py -q build

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  pwd   time


~/github/python/master master* ⇡
❯ ./python -m trace --trace ./lel.py
 --- modulename: lel, funcname: 
lel.py(1): a = b = x = y = z = 1
lel.py(2): if a == 1:
lel.py(3): if b == 1:
lel.py(4): x = 4
lel.py(6): y = 6
lel.py(9): assert (a, b, x, y, z) == (1, 1, 4, 1, 1)

--

___
Python tracker 

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



[issue42093] Add opcode cache for LOAD_ATTR

2021-01-02 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +22903
pull_request: https://github.com/python/cpython/pull/24070

___
Python tracker 

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



[issue42093] Add opcode cache for LOAD_ATTR

2021-01-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9e8fe1986cb4205fb9f883c89b9d5d76a9847e0b by Pablo Galindo in 
branch 'master':
bpo-42093: Tweak the what's new message about the new LOAD_ATTR opcode cache 
(GH-24070)
https://github.com/python/cpython/commit/9e8fe1986cb4205fb9f883c89b9d5d76a9847e0b


--

___
Python tracker 

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



[issue7946] Convoy effect with I/O bound threads and New GIL

2021-01-02 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> wont fix

___
Python tracker 

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



[issue42812] @overload-ing method of parent class without actual implementation

2021-01-02 Thread Chaim Gewirtz


New submission from Chaim Gewirtz :

Why should @overload need to be followed by an implementation when an 
implementation already exists in the parent class?

Illustrative example:

class Parent:
def foo(**kwargs):
"""Argument names of foo vary depending on the child class."""

class Child(Parent):
@overload foo(a, b): ...

Raises:

"NotImplementedError: You should not call an overloaded function. A series of 
@overload-decorated functions outside a stub module should always be followed 
by an implementation that is not @overload-ed."

--
messages: 384255
nosy: chaim422
priority: normal
severity: normal
status: open
title: @overload-ing method of parent class without actual implementation
type: enhancement
versions: Python 3.10

___
Python tracker 

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