[issue45863] tarfile zeroes ustar header fields unnecessarily

2021-11-22 Thread Joshua Root


New submission from Joshua Root :

When using the pax format, tarfile will zero out the field in the ustar header 
for any values that are represented with a float, setting the correct value 
only in the pax header. This mainly seems to apply to the mtime. This behaviour 
doesn't cause problems when using an unarchiver that understands the pax 
header, but unarchivers that don't will extract incorrect metadata (most 
obviously all mtimes set to the epoch). Compatibility with such unarchivers can 
easily be achieved by rounding the float value to int for the ustar header 
only, thus at least giving mtimes that are accurate to the nearest second 
instead of nothing.

--
components: Library (Lib)
messages: 406744
nosy: jmr
priority: normal
severity: normal
status: open
title: tarfile zeroes ustar header fields unnecessarily
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45723] Improve and simplify configure.ac checks

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset db2277a114463d30a58d9066f2b47f7a53a1488c by Erlend Egeberg 
Aasland in branch 'main':
bpo-45723: Add helpers for save/restore env (GH-29637)
https://github.com/python/cpython/commit/db2277a114463d30a58d9066f2b47f7a53a1488c


--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 133c65a870e8bdcce7cd6a2bc6bd0cefbb2fa9f3 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port array, _contextvars, math, and cmath to PY_STDLIB_MOD_SIMPLE 
(GH-29688)
https://github.com/python/cpython/commit/133c65a870e8bdcce7cd6a2bc6bd0cefbb2fa9f3


--

___
Python tracker 

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



[issue45863] tarfile zeroes ustar header fields unnecessarily

2021-11-22 Thread Joshua Root


Change by Joshua Root :


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

___
Python tracker 

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



[issue45509] Gzip header corruption not properly checked.

2021-11-22 Thread Ruben Vorderman


Ruben Vorderman  added the comment:

Ping

--

___
Python tracker 

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



[issue45862] Anomaly of eval() of list comprehension

2021-11-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

Thanks for the report. The behaviour is by design: see #5242 (especially 
msg81898) for an explanation.

Closing this issue as a duplicate of #5242.

--
nosy: +mark.dickinson
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> eval() function in List Comprehension doesn't work

___
Python tracker 

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



[issue45862] Anomaly of eval() of list comprehension

2021-11-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

See also #41216

--

___
Python tracker 

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



[issue45862] Anomaly of eval() of list comprehension

2021-11-22 Thread David Pratten

David Pratten  added the comment:

Hi Mark,

Thanks.  

The anomaly is that the print("eg def2", ...)  works.  Should it not fail in 
the same way that print("eg def4", ...) does.

David

On 22/11/2021 7:36:31 PM, Mark Dickinson  wrote:

Mark Dickinson added the comment:

Thanks for the report. The behaviour is by design: see #5242 (especially 
msg81898) for an explanation.

Closing this issue as a duplicate of #5242.

--
nosy: +mark.dickinson
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> eval() function in List Comprehension doesn't work

___
Python tracker

___

[755e9508-5fde-465a-ac8e-d82585c103f3]

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset 718cee08cc082ece590f5a012253a405422da03d by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port _bisect, _heapq, _json, _pickle, _random, and _zoneinfo to 
PY_STDLIB_MOD_SIMPLE (GH-29689)
https://github.com/python/cpython/commit/718cee08cc082ece590f5a012253a405422da03d


--
nosy: +miss-islington

___
Python tracker 

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



[issue45862] Anomaly of eval() of list comprehension

2021-11-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

True: there's another detail here that's needed to explain the behaviour. The 
first "for" clause in a list comprehension is special: it's evaluated in the 
enclosing scope, rather than in the local function scope that the list 
comprehension creates. See the docs here: 
https://docs.python.org/3.9/reference/expressions.html?highlight=list%20comprehension#displays-for-lists-sets-and-dictionaries

--

___
Python tracker 

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



[issue45509] Gzip header corruption not properly checked.

2021-11-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it is good idea, although we may get reports about regressions in 3.11 
when Python will start to reject GZIP files which was successfully read before.

But before merging this I want to know:

1. How much overhead does it add for reading files with the FHCRC flag clear?
2. How much overhead does it add for reading files with the FHCRC flag set?
3. Are GZIP files created by other tools has the FHCRC flag by default?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

45 down, 35 to go.

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset 39f7d2ff01eb03f1dd87a019472a32cde6250e84 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port _lfprof, _opcode, _asyncio, _queue, _statistics, and _typing to 
PY_STDLIB_MOD_SIMPLE (GH-29690)
https://github.com/python/cpython/commit/39f7d2ff01eb03f1dd87a019472a32cde6250e84


--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27932
pull_request: https://github.com/python/cpython/pull/29696

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27933
pull_request: https://github.com/python/cpython/pull/29697

___
Python tracker 

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



[issue45864] unittest does not discover tests in PEP420 packages

2021-11-22 Thread Adam Johnson

New submission from Adam Johnson :

unittest's test discovery does not descend into directories without 
`__init__.py`. This avoids discovering test modules that are otherwise valid 
and importable, after PEP 420.

I've seen this more than once where there were valid looking test files not 
being discovered, and they bit rot. The tests had been run individually when 
created but never again.

(I created [flake8-no-pep420](https://pypi.org/project/flake8-no-pep420/) to 
avoid this problem on my projects.)

For example, take this directory structure:

```
$ tree
.
└── tests
└── test_thing.py

1 directory, 1 file

$ cat tests/test_thing.py
1/0
```

It's valid to import the naughty file, which crashes:

```
$ python -c 'import tests.test_thing'
Traceback (most recent call last):
  File "", line 1, in 
  File "/.../tests/test_thing.py", line 1, in 
1/0
ZeroDivisionError: division by zero
```

But unittest does not discover it:

```
$ python -m unittest

--
Ran 0 tests in 0.000s

OK
```

But, after creating an empty `__init__.py`, the tests doth fail:

```
$ touch tests/__init__.py

$ python -m unittest
E
==
ERROR: tests.test_thing (unittest.loader._FailedTest)
--
ImportError: Failed to import test module: tests.test_thing
Traceback (most recent call last):
  File "/.../unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
  File "/.../unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
  File "/.../tests/test_thing.py", line 1, in 
1/0
ZeroDivisionError: division by zero


--
Ran 1 test in 0.000s

FAILED (errors=1)
```

--
components: Tests
messages: 406756
nosy: adamchainz
priority: normal
severity: normal
status: open
title: unittest does not discover tests in PEP420 packages
type: behavior

___
Python tracker 

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



[issue45865] Old syntax in unittest

2021-11-22 Thread Adam Johnson


New submission from Adam Johnson :

I often browse the unittest code in order to write extensions. It still uses 
some Python 2-isms like classes inheriting from object, it would be nice to 
clean that up.

--
components: Tests
messages: 406757
nosy: adamchainz
priority: normal
severity: normal
status: open
title: Old syntax in unittest
type: enhancement

___
Python tracker 

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



[issue45865] Old syntax in unittest

2021-11-22 Thread Adam Johnson


Change by Adam Johnson :


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

___
Python tracker 

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



[issue34943] sched cancel (wrong item removed from queue)

2021-11-22 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Document that sched.cancel() doesn't distinguish equal events 
and can break order

___
Python tracker 

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



[issue19270] sched.cancel() doesn't distinguish equal events and can break order

2021-11-22 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: Document that sched.cancel() doesn't distinguish equal events and can 
break order -> sched.cancel() doesn't distinguish equal events and can break 
order
type: enhancement -> behavior
versions: +Python 3.10 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue45509] Gzip header corruption not properly checked.

2021-11-22 Thread Ruben Vorderman


Ruben Vorderman  added the comment:

1. Quite a lot

I tested it for the two most common use case. 
import timeit
import statistics

WITH_FNAME = """
from gzip import GzipFile, decompress
import io
fileobj = io.BytesIO()
g = GzipFile(fileobj=fileobj, mode='wb', filename='compressable_file')
g.write(b'')
g.close()
data=fileobj.getvalue()
"""
WITH_NO_FLAGS = """
from gzip import decompress
import zlib
data = zlib.compress(b'', wbits=31)
"""

def benchmark(name, setup, loops=1, runs=10):
print(f"{name}")
results = [timeit.timeit("decompress(data)", setup, number=loops) for _ in 
range(runs)]
# Calculate microseconds
results = [(result / loops) * 1_000_000 for result in results]
print(f"average: {round(statistics.mean(results), 2)}, "
  f"range: {round(min(results), 2)}-{round(max(results),2)} "
  f"stdev: {round(statistics.stdev(results),2)}")


if __name__ == "__main__":
benchmark("with_fname", WITH_FNAME)
benchmark("with_noflags", WITH_FNAME)

BEFORE:

with_fname
average: 3.27, range: 3.21-3.36 stdev: 0.05
with_noflags
average: 3.24, range: 3.14-3.37 stdev: 0.07

AFTER:
with_fname
average: 4.98, range: 4.85-5.14 stdev: 0.1
with_noflags
average: 4.87, range: 4.69-5.05 stdev: 0.1

That is a dramatic increase in overhead. (Okay the decompressed data is empty, 
but still)

2. Haven't tested this yet. But the regression is quite unacceptable already.

3. Not that I know of. But if it is set, it is safe to assume they care. 
Nevertheless this is a bit of an edge-case.

--

___
Python tracker 

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



[issue45864] unittest does not discover tests in PEP420 packages

2021-11-22 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to be similar to https://bugs.python.org/issue23882

--
nosy: +methane, xtreak

___
Python tracker 

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



[issue45864] unittest does not discover tests in PEP420 packages

2021-11-22 Thread Adam Johnson


Adam Johnson  added the comment:

It's exactly that ticket. I missed that when searching for duplicates - I only 
searched for "pep420" and not "namespace packages". Mea culpa.

--
resolution:  -> duplicate

___
Python tracker 

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



[issue45864] unittest does not discover tests in PEP420 packages

2021-11-22 Thread Adam Johnson


Change by Adam Johnson :


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



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2021-11-22 Thread Adam Johnson


Adam Johnson  added the comment:

I just reported https://bugs.python.org/issue45864 , and closed as duplicate of 
this.

--
nosy: +adamchainz

___
Python tracker 

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



[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-11-22 Thread Mark Shannon


Mark Shannon  added the comment:

I'm seeing a similar failure on a debug build of 3.10 as well.

./python 
Python 3.10.0+ (heads/3.10:9e7a2e4920, Nov 22 2021, 10:51:32) [GCC 9.3.0] on 
linux
Type "help", "copyright", "credits" or "license" for more information.
>>> async def f():
... pass
... 
>>> coro = f()
>>> frame = coro.cr_frame
>>> frame.clear()
:1: RuntimeWarning: coroutine 'f' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
python: Objects/frameobject.c:695: frame_clear: Assertion `f->f_gen == NULL' 
failed.
Aborted (core dumped)


I don't know why that assertion is there, it doesn't seem to be valid.

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27935
pull_request: https://github.com/python/cpython/pull/29699

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 29699a2a2aa2f0d6e790beeae55967fc2f35fe50 by Christian Heimes in 
branch 'main':
bpo-45847: Various PY_STDLIB_MOD cleanups (GH-29697)
https://github.com/python/cpython/commit/29699a2a2aa2f0d6e790beeae55967fc2f35fe50


--

___
Python tracker 

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



[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-11-22 Thread Mark Shannon


Change by Mark Shannon :


--
assignee:  -> Mark.Shannon
keywords: +3.11regression
priority: normal -> release blocker

___
Python tracker 

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



[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-11-22 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue45866] Out of tree build of Python 3.11.0a2+ breaks regen-frozen

2021-11-22 Thread Miro Hrončok

New submission from Miro Hrončok :

In Fedora, when building Python 3.11.0a2 with Python 3.11.0a2 for regen, we 
found that regen-frozen fails.

It can be reproduced either on the v3.11.0a2 tag or on the main branch.

On tag v3.11.0a2 with 3.11.0a2 installed in $PATH:

# in root of cpython local clone:
$ git clean -fdx
$ mkdir -p build/optimized
$ cd build/optimized
$ ../../configure
$ make regen-all PYTHON_FOR_REGEN=python3.11
...
ERROR: missing _freeze_module


On the main branch:

# in root of cpython local clone:
$ git clean -fdx
$ mkdir -p build/optimized
$ cd build/optimized
$ ../../configure
$ make
$ make regen-all PYTHON_FOR_REGEN=./python
(success)

However, the working tree is dirty:

$ git diff
diff --git a/Parser/parser.c b/Parser/parser.c
index b3aa35989ed..c26cd6eeb05 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -1,4 +1,4 @@
-// @generated by pegen from ./Grammar/python.gram
+// @generated by pegen from ../../Grammar/python.gram
 #include "pegen.h"
 
 #if defined(Py_DEBUG) && defined(Py_BUILD_CORE)
diff --git a/Tools/peg_generator/pegen/grammar_parser.py 
b/Tools/peg_generator/pegen/grammar_parser.py
index 6e9f7d3d11d..fbbbfad76b0 100644
--- a/Tools/peg_generator/pegen/grammar_parser.py
+++ b/Tools/peg_generator/pegen/grammar_parser.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python3.8
-# @generated by pegen from ./Tools/peg_generator/pegen/metagrammar.gram
+# @generated by pegen from ../../Tools/peg_generator/pegen/metagrammar.gram
 
 import ast
 import sys


And if we install Python somewhere:

$ make
$ make install DESTDIR=/tmp/python

And use that one again for regen:

$ cd ../..
$ git clean -fdx
$ mkdir -p build/optimized
$ cd build/optimized
$ ../../configure
$ make regen-all PYTHON_FOR_REGEN=/tmp/python/usr/local/bin/python3.11
...
# Regenerate Lib/keyword.py from Grammar/python.gram and Grammar/Tokens
# using Tools/peg_generator/pegen
PYTHONPATH=../../Tools/peg_generator /tmp/python/usr/local/bin/python3.11 -m 
pegen.keywordgen \
../../Grammar/python.gram \
../../Grammar/Tokens \
../../Lib/keyword.py.new
/tmp/python/usr/local/bin/python3.11 ../../Tools/scripts/update_file.py 
../../Lib/keyword.py ../../Lib/keyword.py.new
/tmp/python/usr/local/bin/python3.11 ../../Tools/scripts/freeze_modules.py
ERROR: missing _freeze_module
make: *** [Makefile:1259: regen-frozen] Error 1



It fails. I've isolated the failure to:

$ make regen-frozen PYTHON_FOR_REGEN=/tmp/python/usr/local/bin/python3.11
/tmp/python/usr/local/bin/python3.11 ../../Tools/scripts/freeze_modules.py
ERROR: missing _freeze_module
make: *** [Makefile:1259: regen-frozen] Error 1

--
components: Build
messages: 406764
nosy: eric.snow, hroncok, petr.viktorin, vstinner
priority: normal
severity: normal
status: open
title: Out of tree build of Python 3.11.0a2+ breaks regen-frozen
type: compile error
versions: Python 3.11

___
Python tracker 

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



[issue45723] Improve and simplify configure.ac checks

2021-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27937
pull_request: https://github.com/python/cpython/pull/29701

___
Python tracker 

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



[issue45867] kwarg default value expression incorrectly evaluated

2021-11-22 Thread Muhamed Itani


New submission from Muhamed Itani :

I have an MPYFrame class that inherits from tkinter.Frame. It's init looks like 
this:

from os.path import normcase,normpath
def 
__init__(self,master=None,port=None,baudrate=115200,timeout=1,localFolder=normcase(normpath(os.getcwd(:

The problem is, when I check/access the value of localFolder later in the code 
(even directly as a first statement within __init__), it is obvious that 
os.getcwd() is executing, but normcase and/or normpath are not. The resulting 
path contains capital letters (tested on Windows 11), even though it should 
not. If I run:
localFolder=normcase(normpath(localFolder))

as a first statement after init, then check the value of localFolder (for 
example at a debugging breakpoint), it correctly then contains a normalized 
path in which all letters have been converted to lowercase (but only after the 
statement itself has executed).

--
components: Parser
files: mpyFrame.pyw
messages: 406765
nosy: lys.nikolaou, moefear85, pablogsal
priority: normal
severity: normal
status: open
title: kwarg default value expression incorrectly evaluated
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50456/mpyFrame.pyw

___
Python tracker 

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



[issue45866] Out of tree build of Python 3.11.0a2+ breaks regen-frozen

2021-11-22 Thread Miro Hrončok

Miro Hrončok  added the comment:

git bisect says:

ff8859d965815e8b5af346bd90299cfa5568c855 is the first new commit
commit ff8859d965815e8b5af346bd90299cfa5568c855
Author: Victor Stinner 
Date:   Thu Oct 7 21:19:13 2021 +0200

bpo-45402: Fix test_tools.test_sundry() (GH-28786)

Fix test_tools.test_sundry() when Python is built out of tree: fix
how the freeze_modules.py tool locates the _freeze_module program.

 Misc/NEWS.d/next/Tests/2021-10-07-13-43-01.bpo-45402.jlQvep.rst | 3 +++
 Tools/scripts/freeze_modules.py | 7 ---
 2 files changed, 7 insertions(+), 3 deletions(-)
 create mode 100644 
Misc/NEWS.d/next/Tests/2021-10-07-13-43-01.bpo-45402.jlQvep.rst

It seems the fix for an out-of-tree build bug introduced another one.

--

___
Python tracker 

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



[issue45402] ERROR: test_sundry (test.test_tools.test_sundry.TestSundryScripts): SystemExit: ERROR: missing _freeze_module

2021-11-22 Thread Miro Hrončok

Miro Hrončok  added the comment:

There seem to be a regression in this fix, see 
https://bugs.python.org/issue45866

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27938
pull_request: https://github.com/python/cpython/pull/29702

___
Python tracker 

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



[issue45868] xattr support missing in os module under cygwin

2021-11-22 Thread Oskar Enoksson


New submission from Oskar Enoksson :

With the latest Python 3.8.10 under cygwin the following fails:

>>> import os
>>> os.listxattr('.')
Traceback (most recent call last):
  File "", line 1, in < module>
AttributeError: module 'os' has no attribute 'listxattr'

/usr/include/attr/xattr.h declares the corresponding library functions, so 
something must be wrong in the configuration/compilation of python itself.

--
components: Build
messages: 406768
nosy: enok2
priority: normal
severity: normal
status: open
title: xattr support missing in os module under cygwin
type: crash
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



[issue45866] Out of tree build of Python 3.11.0a2+ breaks regen-frozen

2021-11-22 Thread Miro Hrončok

Miro Hrončok  added the comment:

It also seems that it is *not* necessary to use Python 3.11 for regen-frozen to 
get the failure:

$ make regen-frozen PYTHON_FOR_REGEN=python3.10
python3.10 ../../Tools/scripts/freeze_modules.py
ERROR: missing _freeze_module
make: *** [Makefile:1259: regen-frozen] Error 1

$ make regen-frozen PYTHON_FOR_REGEN=python3.9
python3.9 ../../Tools/scripts/freeze_modules.py
ERROR: missing _freeze_module
make: *** [Makefile:1259: regen-frozen] Error 1


My guess is that the fix for test_tools.test_sundry() actually broke the real 
usage. It has:

# When building out of the source tree, get the tool from directory
# of the Python executable
TOOL = os.path.dirname(sys.executable)
TOOL = os.path.join(TOOL, 'Programs', '_freeze_module')

But sys.executable is *not* the Python we have built, but the Python we use for 
regen.
E.g. when Python for regen is /usr/bin/python3.X, it tries to use 
/usr/bin/Programs/_freeze_module which obviously is not there.

The assumption that sys.executable is the freshly built Python is only correct 
in the tests, but not in reality.

--

___
Python tracker 

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



[issue45867] kwarg default value expression incorrectly evaluated

2021-11-22 Thread Muhamed Itani


Change by Muhamed Itani :


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



[issue45867] kwarg default value expression incorrectly evaluated

2021-11-22 Thread Muhamed Itani


Change by Muhamed Itani :


Removed file: https://bugs.python.org/file50456/mpyFrame.pyw

___
Python tracker 

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



[issue45865] Old syntax in unittest

2021-11-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

As a general rule, we don't accept large patches with changes like this. The 
chance for breakage somewhere in the 27 files is too high.

I could see maybe dropping inheriting from object, since that's relatively safe.

--
nosy: +eric.smith

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 5b946cadaa1175a5caae98bd2d309840bea52a58 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port fcntl to Py_STDLIB_MOD (GH-29696)
https://github.com/python/cpython/commit/5b946cadaa1175a5caae98bd2d309840bea52a58


--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27939
pull_request: https://github.com/python/cpython/pull/29703

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-11-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-11-22 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset d3062f672c92855b7e9e962ad4bf1a67abd4589b by Eric V. Smith in 
branch 'main':
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but 
init=False (GH-29692)
https://github.com/python/cpython/commit/d3062f672c92855b7e9e962ad4bf1a67abd4589b


--

___
Python tracker 

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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Joran van Apeldoorn


New submission from Joran van Apeldoorn :

The expectation would be that the re.A (or re.ASCII) flag should not impact the 
matching behavior of a regular expression on strings consisting only of ASCII 
characters.  However, for the characters 0x1c till 0x1f, the classes \s and \S 
differ. For ASCII theses characters are not considered space characters while 
for unicode they are. 

Note that python strings do consider these characters spaces as 
'\xc1'.isspace() gives True. 

All other classes and characters stay the same for unicode and ASCII matching.

--
components: Regular Expressions
files: unicode-ascii-space.py
messages: 406773
nosy: control-k, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Unicode and acii regular expressions do not agree on ascii space 
characters
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50457/unicode-ascii-space.py

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-11-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks for the bug report!

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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Joran van Apeldoorn


Change by Joran van Apeldoorn :


--
type:  -> behavior

___
Python tracker 

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



[issue45857] PEP 604 Union syntax does not support forward references

2021-11-22 Thread Ken Jin


Ken Jin  added the comment:

I think I saw a similar bug report elsewhere (or maybe I'm misremembering). 
Anyways, Eric is right, the correct way is to wrap the entire thing, so 
"Foo|int" instead of "Foo"|int.

@Alex you brought up some good suggestions, I'll try to address them:

> Arguably, either the implementation should be altered to support forward 
> references

Unfortunately that's more complex than it seems. The original draft PEP 604 
proposed implementation actually imported Union from typing.py, and I recall 
Guido disliking the idea that a builtin type should depend on typing.py. I have 
to agree with that philosophy here. I also don't think the alternative -- 
implementing a builtin ForwardRef type isn't worth the complexity unless our 
situation changes.

> the documentation at 
> https://docs.python.org/3/library/stdtypes.html#union-type should be altered 
> to make clear that ...

The first line says: "A union object holds the value of the | (bitwise or) 
operation on multiple type objects." It says *type objects*, which strings 
don't belong to.

@TNThung does Eric's suggestion work for you? Or do you need something else?

--
status: open -> pending

___
Python tracker 

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



[issue44649] dataclasses slots with init=False field raises AttributeException

2021-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset 10343bd98390ef15909e3a19f26a6178162996fd by Miss Islington (bot) 
in branch '3.10':
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but 
init=False (GH-29692)
https://github.com/python/cpython/commit/10343bd98390ef15909e3a19f26a6178162996fd


--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset b451673f93465a27ee61e408190ee61cb9dbd5b6 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port mmap, select, and _xxsubinterpreters to Py_STDLIB_MOD (GH-29703)
https://github.com/python/cpython/commit/b451673f93465a27ee61e408190ee61cb9dbd5b6


--

___
Python tracker 

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



[issue45870] There's no readline module on Windows Python (cmd.Cmd)

2021-11-22 Thread keeely


New submission from keeely :

In the past this was worked around by installing a third-party module:
https://github.com/pyreadline/pyreadline

For Python 3.10, however this module doesn't work.  And pyreadline doesn't seem 
to be maintained anymore, so it's possible it won't get fixed.
https://github.com/pyreadline/pyreadline/issues/73

Consider the following code:

import cmd
import readline

open("history.txt", "w").write("first line\nsecond line\n")

readline.clear_history()
readline.read_history_file("history.txt")

class MyShell(cmd.Cmd):
def __init__(self):
super().__init__()

shell = MyShell()
shell.cmdloop()

This works fine on MacOs Python, also on Linux and on Windows prior to 3.10 
with the readline module added.  It won't work going forward.

The Windows cmd implementation clearly uses readline or some compatible lib 
under the hood, so Python should make it available to developers.

--
components: Library (Lib)
messages: 406778
nosy: keeely
priority: normal
severity: normal
status: open
title: There's no readline module on Windows Python (cmd.Cmd)
type: behavior
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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset d9cedabeba0d87799f99c0717e81743a1c2d34ce by Christian Heimes in 
branch 'main':
bpo-45847: Port compression libs to PY_STDLIB_MOD (GH-29702)
https://github.com/python/cpython/commit/d9cedabeba0d87799f99c0717e81743a1c2d34ce


--

___
Python tracker 

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



[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-11-22 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e by Mark Shannon in 
branch 'main':
bpo-45813: Make sure that frame->generator is NULLed when generator is 
deallocated. (GH-29700)
https://github.com/python/cpython/commit/7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e


--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27941
pull_request: https://github.com/python/cpython/pull/29705

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27942
pull_request: https://github.com/python/cpython/pull/29706

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset c6dec7e27a82cba33539d07ef8d7346e0a232421 by Christian Heimes in 
branch 'main':
bpo-45847: Port nis module to PY_STDLIB_MOD (GH-29699)
https://github.com/python/cpython/commit/c6dec7e27a82cba33539d07ef8d7346e0a232421


--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:

Not converted yet:

readline
_curses
_curses_panel
_crypt
_socket
_ssl
_hashlib
_dbm
_gdbm
_ctypes
_multiprocessing
_posixshmem
_tkinter
_uuid
xxlimited
xxlimited_35

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

_socket coming up...

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread miss-islington


miss-islington  added the comment:


New changeset eee683cbde499e62fc90ad366f7c45625fe92150 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port audioop, _csv, and _posixsubprocess to PY_STDLIB_MOD_SIMPLE 
(GH-29705)
https://github.com/python/cpython/commit/eee683cbde499e62fc90ad366f7c45625fe92150


--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:

_crypt is powered by pkgconf libcrypt or libxcrypt on Linux. On my system  and 
on Debian, libcrypt.pc is a symlink to libxcrypt.pc. Linux has crypt() and/or 
crypt_r() in . On FreeBSD crypt_r() is in  and libc.

_uuid needs similar special handling. It's , -luuid, and uuid.pc 
on Linux. On BSD it's  and symbols are in libc.

_readline uses either libreadline (readline.pc) or libeditline 
(libeditline.pc). It also needs special handling of tinfo and termcap on some 
platforms.

ndbm, gdbm, and libdb have no pkgconf providers. My PR GH-29534 has some code 
to detect them in configure.

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27943
pull_request: https://github.com/python/cpython/pull/29707

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 4fad314246399b69ef0c57ba8527d9efade99069 by Carl Friedrich 
Bolz-Tereick in branch 'main':
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only 
(GH-29691)
https://github.com/python/cpython/commit/4fad314246399b69ef0c57ba8527d9efade99069


--

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27945
pull_request: https://github.com/python/cpython/pull/29709

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27946
pull_request: https://github.com/python/cpython/pull/29710

___
Python tracker 

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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Joran van Apeldoorn


Joran van Apeldoorn  added the comment:

Small addition, the sre categories CATEGORY_LINEBREAK and 
CATEGORY_UNI_LINEBREAK also do not agree on ASCII characters.
The first is only '\n' while the second also includes for example '\r' and some 
others. These do not seem to correspond to anything however and are never used 
in sre_parse.py or sre_compile.py.

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 0e1c2f3ef84572b79fa7d8498a69bc5a56ff0d8d by Christian Heimes in 
branch 'main':
bpo-45847: port _struct to PY_STDLIB_MOD (GH-29706)
https://github.com/python/cpython/commit/0e1c2f3ef84572b79fa7d8498a69bc5a56ff0d8d


--

___
Python tracker 

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



[issue45843] Optimizing constant comparisons/contains

2021-11-22 Thread theeshallnotknowethme


Change by theeshallnotknowethme :


--
title: Optimizing LOAD_CONST followed by COMPARE_OP (or IS_OP) -> Optimizing 
constant comparisons/contains

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 56b5cd52ab58d8f2f11f253ec1bb3e6000d2dbd2 by Miss Islington (bot) 
in branch '3.10':
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only 
(GH-29691) (GH-29708)
https://github.com/python/cpython/commit/56b5cd52ab58d8f2f11f253ec1bb3e6000d2dbd2


--

___
Python tracker 

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



[issue32582] chr raises OverflowError

2021-11-22 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Irit Katriel


New submission from Irit Katriel :

The validation will be shared with except* so this refactor is prep for 
implementing PEP-654.

Also need to add the missing unit test for the validation.

--
messages: 406790
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH
versions: Python 3.11

___
Python tracker 

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



[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Irit Katriel


Change by Irit Katriel :


--
assignee:  -> iritkatriel

___
Python tracker 

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



[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 455ed45d7c30c5f2a31c524b015c48ac85f3d27c by Miss Islington (bot) 
in branch '3.9':
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only 
(GH-29691) (GH-29709)
https://github.com/python/cpython/commit/455ed45d7c30c5f2a31c524b015c48ac85f3d27c


--

___
Python tracker 

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



[issue45859] test_collections has a wrong test in case _itemgetter is not available

2021-11-22 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



[issue45857] PEP 604 Union syntax does not support forward references

2021-11-22 Thread Alex Waygood


Alex Waygood  added the comment:

Thanks, Ken! To clarify: I agree that changing the implementation here would 
probably be a bad way to go: it would be foolish to try to replicate all the 
functionality of the typing module as builtins. I also think the existing 
documentation at https://docs.python.org/3/library/stdtypes.html#union-type is 
actually very good, so I don't think it needs a fundamental rewrite by any 
means.

I do still think a sentence or two could be added to the documentation, 
however, clarifying how to deal with forward references, since the behaviour 
here is different to the older, more established syntax using typing.Union. 
Something like this?

"""
Note: The object on both sides of the | operand must be an object that defines 
the __or__ special method. As the str type does not support __or__, the 
expression `int | "Foo"`, where  "Foo" is a reference to a class not yet 
defined, will fail at runtime. To annotate forward references using union-type 
expressions, present the whole expression as a string, e.g. `"int | Foo"`.
"""

--
status: pending -> open

___
Python tracker 

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



[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 4d6c0c0cce05befa06e0cad7351b1303ac048277 by Irit Katriel in 
branch 'main':
bpo-45871: Refactor except matcher validation into a separate function so that 
it can be reused. Add missing unit test. (GH-29711)
https://github.com/python/cpython/commit/4d6c0c0cce05befa06e0cad7351b1303ac048277


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue45871] Refactor exception matcher validation out of JUMP_IF_NOT_EXC_MATCH

2021-11-22 Thread Irit Katriel


Change by Irit Katriel :


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



[issue45459] Limited API support for Py_buffer

2021-11-22 Thread Alex Gaynor


Alex Gaynor  added the comment:

I am someone who is interested in having this, but FWIW my motivation is 
slightly more narrow, I only really need abi3-friendly buffer support with 
contiguous 1d buffers. Not sure if there'd be interest in doing a smaller 
version before figuring out the entire Py_buffer API.

--
nosy: +alex

___
Python tracker 

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



[issue45872] Turtle documentation, write()

2021-11-22 Thread Pavel V


New submission from Pavel V :

There are no parentheses for 'font' argument in turtle.write() documentation

https://docs.python.org/3.10/library/turtle.html#turtle.write

--
assignee: docs@python
components: Documentation
messages: 406795
nosy: docs@python, willyns
priority: normal
severity: normal
status: open
title: Turtle documentation, write()
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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-22 Thread Matthew Barnett


Matthew Barnett  added the comment:

For comparison, the regex module says that 0x1C..0x1F aren't whitespace, and 
the Unicode property White_Space ("\p{White_Space}" in a pattern, where 
supported) also says that they aren't whitespace.

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27948
pull_request: https://github.com/python/cpython/pull/29713

___
Python tracker 

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



[issue45850] Port deep-freeze to Windows

2021-11-22 Thread Guido van Rossum


New submission from Guido van Rossum :


New changeset 1037ca5a8ea001bfa2a198e08655620234e9befd by Guido van Rossum in 
branch 'main':
bpo-45850: Implement deep-freeze on Windows (#29648)
https://github.com/python/cpython/commit/1037ca5a8ea001bfa2a198e08655620234e9befd


--

___
Python tracker 

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



[issue45850] Port deep-freeze to Windows

2021-11-22 Thread Guido van Rossum


Change by Guido van Rossum :


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

___
Python tracker 

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



[issue45873] Stop using bootstrap_python for deep-freeze in UNIX builds

2021-11-22 Thread Guido van Rossum


New submission from Guido van Rossum :

Now that we've got a way (for Windows) to deep-freeze without building a 
bootstrap Python binary, we should do the same for UNIX.

--
components: Build
messages: 406798
nosy: gvanrossum
priority: normal
severity: normal
stage: needs patch
status: open
title: Stop using bootstrap_python for deep-freeze in UNIX builds
versions: Python 3.11

___
Python tracker 

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



[issue45865] Old syntax in unittest

2021-11-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Concur with Eric.

--
nosy: +serhiy.storchaka
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



[issue45843] Optimizing constant comparisons/contains

2021-11-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue45870] There's no readline module on Windows Python (cmd.Cmd)

2021-11-22 Thread Eryk Sun


Eryk Sun  added the comment:

> The Windows cmd implementation clearly uses readline or 
> some compatible lib under the hood

The REPL shell and input() call PyOS_Readline(). If this call isn't hooked 
(e.g. by the readline module), and stdin is a console file, then it reads a 
line from the console via ReadConsoleW(). If the console's input stream is 
configured in line-input mode, which we assume it is, this function provides 
basic readline-ish support, including a line editor that supports input history 
and aliases. The history is stored in an in-memory buffer in the console, which 
doesn't get save and reused across console sessions. There is no public API to 
get the history contents, and there is no support at all to set it. 

The console/terminal team at Microsoft apparently don't want to do anything 
with the builtin readline support, which is seen as a legacy feature. To the 
contrary, I've even seen them suggest that they're evaluating the addition of a 
new client-side readline library in the native API, which I assume would be 
similar to PowerShell's PSReadLine (e.g. based on ReadConsoleInputW(), and 
supporting a classic console mode in addition to emacs and vi modes).

For now, I suggest patching pyreadline for your own use. In the reported issue, 
I see it's trying to use collections.Callable. Instead it should import 
collections.abc and use collections.abc.Callable.

--
nosy: +eryksun

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 2dc7d3dda61e7ce07721f46b14c706fbc879dfd6 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port xxlimited and xxlimited_35 to PY_STDLIB_MOD (GH-29707)
https://github.com/python/cpython/commit/2dc7d3dda61e7ce07721f46b14c706fbc879dfd6


--

___
Python tracker 

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



[issue45850] Port deep-freeze to Windows

2021-11-22 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +27950
pull_request: https://github.com/python/cpython/pull/29714

___
Python tracker 

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



[issue45873] Stop using bootstrap_python for deep-freeze in UNIX builds

2021-11-22 Thread Guido van Rossum


Change by Guido van Rossum :


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

___
Python tracker 

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



[issue42367] Restore os.makedirs ability to apply mode to all directories created

2021-11-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

A new `intermediate_mode=` kwarg can't _default_ to `mode=` as that would flip 
flop the API's default behavior again and no doubt disrupt someone elses 
3.7-3.10 authored code depending on it. :(

Regardless I do somewhat like `intermediate_mode=` more than the PR's existing 
`recursive_mode=` as it opens up more possible behaviors... Allowing `None` to 
mean "use `mode=`" is desirable as that'll likely be the most common case.  As 
I expect this to be very common, an easier to type name than intermediate_mode 
is desirable.  Brainstorming:

 * mid_mode?
 * submode?
 * imode?

My preference leans towards the latter names. Probably `submode=`.

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27951
pull_request: https://github.com/python/cpython/pull/29715

___
Python tracker 

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



[issue36706] Python script on startup stucks at import

2021-11-22 Thread Irit Katriel


Irit Katriel  added the comment:

Serge, are you still having this problem and if so can you provide the traces? 
If this issue is abandoned I will close it within a couple of weeks.

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue40324] python 3.8.2 idle not opening

2021-11-22 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as there isn't enough information here to understand the issue and 
there was no reply to followup questions.

Please create a new issue if you still have a problem and are able to explain 
it more fully.

--
nosy: +iritkatriel
resolution:  -> rejected
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



[issue38541] Performance degradation of attribute accesses in Python 3.7.4

2021-11-22 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as this is resolved in 3.8 and we won't do anything about 3.7.

--
nosy: +iritkatriel
resolution:  -> out of date
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



[issue45833] NamedTemporaryFile deleted before enclosing context manager exit

2021-11-22 Thread Zachary Ware


Change by Zachary Ware :


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

___
Python tracker 

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



[issue22067] time_test fails after strptime()

2021-11-22 Thread Irit Katriel


Irit Katriel  added the comment:

I am unable to reproduce this on 3.11.

--
nosy: +iritkatriel
resolution:  -> works for me
status: open -> pending

___
Python tracker 

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



[issue45874] urllib.parse.parse_qsl does not parse empty query string with strict parsing

2021-11-22 Thread Christian Sattler


New submission from Christian Sattler :

Calling
  urllib.parse.parse_qsl('', strict_parsing=True)
yields an error:
  ValueError: bad query field: ''

The empty string '' is produced by
  urllib.parse.urlencode({})
and also as query string by
  urllib.parse.urlsplit('http://example.org/')
so it should be accepted by urllib.parse.parse_qsl with strict parsing. 

The problem is that parse_qsl(qs, ...) cannot distinguish between zero and one 
query arguments. The call to qs.split(separator) returns the non-empty list 
[''] for qs empty, which means one query argument. However, in this case, we 
want the other semantics.

--
components: Library (Lib)
messages: 406807
nosy: sattler
priority: normal
severity: normal
status: open
title: urllib.parse.parse_qsl does not parse empty query string with strict 
parsing
type: behavior
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



  1   2   >