[issue47080] Use atomic groups to simplify fnmatch

2022-03-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, the kernel was also upgraded. /var/log/dnf.log:
---
2022-03-18T19:32:05+0100 DEBUG Installed: kernel-5.17.0-0.rc8.123.fc37.aarch64
---


== Build 440 (old, ok) ==

https://buildbot.python.org/all/#/builders/245/builds/440

os.uname: posix.uname_result(sysname='Linux', 
nodename='python-builder-fedora-rawhide-aarch64', 
release='5.17.0-0.rc0.20220112gitdaadb3bd0e8d.63.fc36.aarch64', version='#1 SMP 
Wed Jan 12 18:56:05 UTC 2022', machine='aarch64')

== Build 445 (new, bug) ==

https://buildbot.python.org/all/#/builders/245/builds/445

os.uname: posix.uname_result(sysname='Linux', 
nodename='python-builder-fedora-rawhide-aarch64', 
release='5.17.0-0.rc8.123.fc37.aarch64', version='#1 SMP Mon Mar 14 17:54:40 
UTC 2022', machine='aarch64')

--

___
Python tracker 

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



[issue46712] Share global string identifiers in deepfreeze

2022-03-20 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

In bpo-47067, there was concern about the addition of the makefile target from 
PR 31637:

regen-global-objects: regen-deepfreeze

After a new `&_Py_ID(__orig_class__)` is added to Objects/genericaliasobject.c, 
running `make regen-global-objects` starts

gcc -pthread -c [snipped] -DPy_BUILD_CORE -o Objects/genericaliasobject.o 
Objects/genericaliasobject.c

which fails with a compilation error because that identifier is not yet 
defined. Is there a good way to convince `make` to regenerate the global 
objects without this sort of circular dependency? Am I missing a step?

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue47079] Integral.denominator shouldn't return an int

2022-03-20 Thread Sergey B Kirpichev


Sergey B Kirpichev  added the comment:

> self(1) instead

or, rather, type(self)(1)

--

___
Python tracker 

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



[issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

Fedora glibc issue: https://bugzilla.redhat.com/show_bug.cgi?id=2066147

--

___
Python tracker 

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



[issue47080] Use atomic groups to simplify fnmatch

2022-03-20 Thread Tim Peters


New submission from Tim Peters :

I added some excruciatingly obscure technical tricks to ensure that 
fnmatch.py's regexps can't fall into exponential-time match failures.

It's hard to stop re from useless backtracking. But the new "atomic groups" 
make that easy instead in some cases, and make it trivial in the cases fnmatch 
needs.

Of course addressing this has to wait for the atomic groups PR to get merged 
GH-31982)

--
assignee: tim.peters
components: Library (Lib)
messages: 415662
nosy: tim.peters
priority: normal
severity: normal
stage: needs patch
status: open
title: Use atomic groups to simplify fnmatch
type: behavior
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



[issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

/var/log/dnf.log:

2022-03-18T19:32:05+0100 DEBUG Upgraded: glibc-2.35.9000-11.fc37.aarch64
...
2022-03-20T06:55:49+0100 DDEBUG Cleaning up.
2022-03-20T06:55:49+0100 DDEBUG 
/var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35-2.fc37.aarch64.rpm 
removed
2022-03-20T06:55:49+0100 DDEBUG 
/var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-7.fc37.aarch64.rpm
 removed
2022-03-20T06:55:49+0100 DDEBUG 
/var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-10.fc37.aarch64.rpm
 removed
2022-03-20T06:55:50+0100 DDEBUG 
/var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-11.fc37.aarch64.rpm
 removed
2022-03-20T06:55:50+0100 DDEBUG 
/var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-6.fc37.aarch64.rpm
 removed
2022-03-20T06:55:50+0100 DDEBUG 
/var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-5.fc37.aarch64.rpm
 removed
2022-03-20T06:55:50+0100 DDEBUG 
/var/cache/dnf/rawhide-135a69fc59e3201d/packages/glibc-2.35.9000-9.fc37.aarch64.rpm
 removed

--

___
Python tracker 

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



[issue47079] Integral.denominator shouldn't return an int

2022-03-20 Thread Sergey B Kirpichev


New submission from Sergey B Kirpichev :

As the __int__() method is required, I believe it can return self(1) instead.

Also, probably +self normalization could be avoided in the Integral.numerator().

--
components: Library (Lib)
messages: 415660
nosy: Sergey.Kirpichev
priority: normal
severity: normal
status: open
title: Integral.denominator shouldn't return an int
type: behavior
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



[issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

# rpm -qf /sbin/ldconfig 
glibc-2.35.9000-11.fc37.aarch64

--

___
Python tracker 

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



[issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed

2022-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_ctypes modified files on aarch64 Fedora Rawhide 3.9 -> test_ctypes 
modified files on aarch64 Fedora Rawhide 3.9: ldconfig crashed

___
Python tracker 

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



[issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9

2022-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +cstratak

___
Python tracker 

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



[issue47078] test_ctypes modified files on aarch64 Fedora Rawhide 3.9

2022-03-20 Thread STINNER Victor


New submission from STINNER Victor :

aarch64 Fedora Rawhide 3.9:
https://buildbot.python.org/all/#/builders/245/builds/445

It seems like the "ldconfig" command crashed (signal 11: SIGSEGV).

ldconfig is used by _findSoname_ldconfig() of ctypes.util which runs the 
"/sbin/ldconfig -p" command with LC_ALL=C and LANG=C env vars.

It looks like a Fedora issue rather than a Python bug.


journalctl:
---
mars 19 20:08:06 python-builder-fedora-rawhide-aarch64 systemd[1]: 
ldconfig.service - Rebuild Dynamic Linker Cache was skipped because all trigger 
condition checks failed.
(...)
mars 19 15:50:06 python-builder-fedora-rawhide-aarch64 audit[1587976]: 
ANOM_ABEND auid=4294967295 uid=1000 gid=1000 ses=4294967295 
subj=system_u:system_r:unconfined_service_t:s0 pid=1587976 comm="ldconfig" 
exe="/usr/sbin/ldconfig" sig=11 res=1
(...)
mars 19 15:50:06 python-builder-fedora-rawhide-aarch64 audit[1587976]: 
ANOM_ABEND auid=4294967295 uid=1000 gid=1000 ses=4294967295 
subj=system_u:system_r:unconfined_service_t:s0 pid=1587976 comm="ldconfig" 
exe="/usr/sbin/ldconfig" sig=11 res=1
(...)
mars 19 01:02:52 python-builder-fedora-rawhide-aarch64 audit[512983]: 
ANOM_ABEND auid=4294967295 uid=1000 gid=1000 ses=4294967295 
subj=system_u:system_r:unconfined_service_t:s0 pid=512983 comm="ldconfig" 
exe="/usr/sbin/ldconfig" sig=11 res=1
(...)
mars 18 19:33:00 python-builder-fedora-rawhide-aarch64 systemd[1]: 
ldconfig.service - Rebuild Dynamic Linker Cache was skipped because all trigger 
condition checks failed.
---

configure:
---
checking for --with-system-ffi... yes
---

test.pythoninfo:
---
CC.version: gcc (GCC) 12.0.1 20220308 (Red Hat 12.0.1-0)
---

Logs:
---
0:00:18 load avg: 12.24 [241/425/1] test_ctypes failed (env changed)
Warning -- files was modified by test_ctypes
test_anon (ctypes.test.test_anon.AnonTest) ... ok
(...)
test_variant_bool (ctypes.test.test_wintypes.WinTypesTest) ... ok

--
Ran 494 tests in 1.350s

OK (skipped=88)
  Before: []
  After:  ['.1587976']

1 test altered the execution environment:
test_ctypes
---

--
components: Tests
messages: 415658
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_ctypes modified files on aarch64 Fedora Rawhide 3.9
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



[issue47077] test_asyncio ignores exception in _ProactorBasePipeTransport.__del__: RuntimeError('Event loop is closed')

2022-03-20 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 Windows8.1 Refleaks 3.x:
https://buildbot.python.org/all/#/builders/511/builds/274

Logs (reformatted manually):
---
0:52:04 load avg: 4.31 [147/433/1] test_asyncio failed (env changed) (41 min 6 
sec) -- running: test_io (3 min 8 sec)
beginning 6 repetitions
123456
.

Executing 
 cb=[_run_until_complete_cb() at 
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py:180]
 created at 
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\unittest\async_case.py:89>
 took 0.125 seconds

Executing 
 took 0.141 seconds

..

Executing 
 took 0.110 seconds

D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\inspect.py:3030: 
ResourceWarning: unclosed 
  arg_val = next(arg_vals)

ResourceWarning: Enable tracemalloc to get the object allocation traceback
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\proactor_events.py:115:
 ResourceWarning: unclosed transport <_ProactorSocketTransport fd=-1 
read=<_OverlappedFuture cancelled>>
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)

ResourceWarning: Enable tracemalloc to get the object allocation traceback

Warning -- Unraisable exception
Exception ignored in: 
Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\proactor_events.py",
 line 116, in __del__
self.close()

  File 
"D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\proactor_events.py",
 line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
^^
  File 
"D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py", 
line 758, in call_soon
self._check_closed()

  File 
"D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py", 
line 519, in _check_closed
raise RuntimeError('Event loop is closed')
^^
RuntimeError: Event loop is closed

.

Executing .foo() running at 
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\test\test_asyncio\test_waitfor.py:133>
 wait_for=
 cb=[_release_waiter()() at 
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\tasks.py:421] 
created at 
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\tasks.py:374> 
took 0.109 seconds

.

Executing 
 cb=[_run_until_complete_cb() at 
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py:180]
 created at 
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\unittest\async_case.py:89>
 took 0.125 seconds

Executing 
 wait_for=
 cb=[_run_until_complete_cb() at 
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\asyncio\base_events.py:180]
 created at 
D:\buildarea\3.x.ware-win81-release.refleak\build\Lib\unittest\async_case.py:89>
 took 0.141 seconds

.
---

--
components: Tests, asyncio
messages: 415657
nosy: asvetlov, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio ignores exception in _ProactorBasePipeTransport.__del__: 
RuntimeError('Event loop is closed')
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



[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread penguin_wwy


penguin_wwy <940375...@qq.com> added the comment:

> You could also try replacing PyObject_SetAttrString with PyObject_SetAttr and 
> adding "__orig_class__" to the global strings with 
> Tools/scripts/generate_global_objects.py, probably for a later PR.

Already done via `make regen-global-objects`

Also, I found that `regen-global-objects` depends on `regen-deepfreeze`, which 
should be a bug. This causes the `regen-global-objects` to be executed with the 
compile task first, and it does not compile successfully at this point because 
of the new symbols(_Py_ID(__orig_class__)) added.

--

___
Python tracker 

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



[issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

> Recent change related to this test: commit 
> e707ceb6e464b24ddc9fdbdac7bfe15f7eeb43fd

This change comes from bpo-47035 "Rewrite asyncio queue tests with 
IsolatedAsyncioTestCase".

--

___
Python tracker 

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



[issue47035] Rewrite asyncio queue tests with IsolatedAsyncioTestCase

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

Please have a look at bpo-47076 "test_asyncio: test_get_cancelled() fails 
randomly on x86-64 macOS 3.x".

--
nosy: +vstinner

___
Python tracker 

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



[issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x

2022-03-20 Thread STINNER Victor


New submission from STINNER Victor :

x86-64 macOS 3.x failures:

* https://buildbot.python.org/all/#/builders/366/builds/2085
* https://buildbot.python.org/all/#/builders/366/builds/2078
* https://buildbot.python.org/all/#/builders/366/builds/2077
* https://buildbot.python.org/all/#/builders/366/builds/2073
* https://buildbot.python.org/all/#/builders/366/builds/2072
* https://buildbot.python.org/all/#/builders/366/builds/2069

Logs:
---
0:18:33 load avg: 2.21 Re-running test_asyncio in verbose mode (matching: 
test_get_cancelled)
test_get_cancelled (test.test_asyncio.test_queues.QueueGetTests) ... ERROR

==
ERROR: test_get_cancelled (test.test_asyncio.test_queues.QueueGetTests)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/asyncio/tasks.py", 
line 490, in wait_for
return fut.result()
   
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/asyncio/queues.py", 
line 158, in get
await getter

asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/unittest/async_case.py",
 line 66, in _callTestMethod
if self._callMaybeAsync(method) is not None:
   
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/unittest/async_case.py",
 line 93, in _callMaybeAsync
return self._asyncioTestLoop.run_until_complete(task)
   ^^
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/asyncio/base_events.py",
 line 650, in run_until_complete
return future.result()
   ^^^
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_asyncio/test_queues.py",
 line 179, in test_get_cancelled
self.assertEqual(1, await get_task)
^^
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_asyncio/test_queues.py",
 line 174, in queue_get
return await asyncio.wait_for(q.get(), 0.051)
   ^^
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/asyncio/tasks.py", 
line 492, in wait_for
raise exceptions.TimeoutError() from exc

TimeoutError
---


Recent change related to this test:

commit e707ceb6e464b24ddc9fdbdac7bfe15f7eeb43fd
Author: Andrew Svetlov 
Date:   Wed Mar 16 16:59:12 2022 +0200

Rewrite asyncio.Queue tests with IsolatedAsyncioTestCace (#31935)

--
components: Tests, asyncio
messages: 415653
nosy: asvetlov, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x
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



[issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

Recent failures.

AMD64 FreeBSD Non-Debug 3.x:
https://buildbot.python.org/all/#/builders/172/builds/1654
---
Warning -- Dangling processes: {}
Warning -- Dangling processes: {}

1 test altered the execution environment:
test_multiprocessing_spawn
---

--

___
Python tracker 

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



[issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:

BaseManager._finalize_manager() timeout should be configurable, the test should 
use the same timeout than support.wait_process() (SHORT_TIMEOUT), and maybe the 
default timeout should be increased?

I propose to use the same timeout for the two process.join(timeout=xxx) calls 
(before/after terminate).

--

___
Python tracker 

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



[issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes

2022-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +erlendaasland, pablogsal

___
Python tracker 

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



[issue47075] test_multiprocessing_spawn leaks QueueManager dangling processes

2022-03-20 Thread STINNER Victor


New submission from STINNER Victor :

Apply attached manager_timeout.patch and run the command:

./python -m test --fail-env-changed test_multiprocessing_spawn -v -m 
test_rapid_restart -F -j4

If you fail to reproduce the issue, replace -j4 with -j10 or use a larger 
number of concurrent jobs.

Output:
---
(...)
0:00:00 load avg: 2.85 Run tests in parallel using 4 child processes
0:00:06 load avg: 3.02 [  1/1] test_multiprocessing_spawn failed (env changed)
test_rapid_restart 
(test.test_multiprocessing_spawn.WithManagerTestManagerRestart) ... ok

test_rapid_restart 
(test.test_multiprocessing_spawn.WithProcessesTestManagerRestart) ... ok
Warning -- Dangling processes: {, }

test_rapid_restart 
(test.test_multiprocessing_spawn.WithThreadsTestManagerRestart) ... ok
Warning -- Dangling processes: {, }
Warning -- Dangling processes: {, }

--
Ran 3 tests in 5.404s

OK
Kill  process group
Kill  process group
Kill  process group

== Tests result: ENV CHANGED ==

1 test altered the execution environment:
test_multiprocessing_spawn

(...)
---


Examples of similar old issues:

* bpo-39932 at https://bugs.python.org/issue39932#msg363925 : 

* bpo-38447: 
* bpo-38796: 
* bpo-34150: 
* bpo-31069 at https://bugs.python.org/issue31069#msg301339 : 


See also the old fixed bpo-31234 "Make support.threading_cleanup() stricter".

--
components: Tests
files: manager_timeout.patch
keywords: patch
messages: 415650
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn leaks QueueManager dangling processes
versions: Python 3.11
Added file: https://bugs.python.org/file50694/manager_timeout.patch

___
Python tracker 

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



[issue46126] Unittest output drives developers to avoid docstrings

2022-03-20 Thread Inada Naoki


Inada Naoki  added the comment:

> As you can see, the location of the failing test in the log is masked, and 
> instead the description is present.

Could you elaborate?

```
test_index_empty (idlelib.idle_test.test_text.MockTextTest)
Failing test with bad description. ... ERROR
(snip)
==
ERROR: test_index_empty (idlelib.idle_test.test_text.MockTextTest)
Failing test with bad description.
--
```

I can see `test_index_empty (idlelib.idle_test.test_text.MockTextTest)` in both 
places. What is masked?

--
nosy: +methane

___
Python tracker 

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



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e63894b3eed8ad2dd7690695f7f07bfbff59c05a by Victor Stinner in 
branch 'main':
bpo-46850: Remove _PyEval_CallTracing() function (GH-32019)
https://github.com/python/cpython/commit/e63894b3eed8ad2dd7690695f7f07bfbff59c05a


--

___
Python tracker 

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



[issue47074] Convenient `simplefilter()` in `warnings.catch_warnings()`

2022-03-20 Thread Zac Hatfield-Dodds


New submission from Zac Hatfield-Dodds :

Many pytest users would like a concise way to either suppress warnings, or 
convert them to errors [1].  The current best approach is:

with warnings.catch_warnings():
warnings.simplefilter("ignore")  # or "error"

but even this becomes tediously verbose when repeated in hundreds of tests 
(which I suspect is responsible for many misuses of `pytest.raises()`).  Since 
these two functions take disjoint arguments [2], I propose allowing 
catch_warnings() to accept arguments for simplefilter() and forward them on:

with warnings.catch_warnings("ignore"):  # or "error"

I have a quick implementation at [3] which I can finish if the idea is 
acceptable.  Although I don't have a concrete use-case for more than the 
'action' and 'category' arguments, forwarding all rather than some makes the 
semantics very simple.

I'd emphasize again that this is very much a convenience-focussed change: I 
estimate that 95% of all uses will pass only `action="error"` or 
`action="ignore"`.  Supporting a concise and simple interface for this seems 
worth the small complication to the design of the warnings module.


[1] see e.g. https://github.com/pytest-dev/pytest/issues/9404 for a long thread
[2] unlike `filterwarnings()`, which has a `module=` argument which would 
collide with `catch_warnings()`
[3] 
https://github.com/python/cpython/compare/main...Zac-HD:zac-hd/one-line-catch-warnings

--
components: Library (Lib)
messages: 415647
nosy: Zac Hatfield-Dodds
priority: normal
severity: normal
status: open
title: Convenient `simplefilter()` in `warnings.catch_warnings()`
type: enhancement
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



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30107
pull_request: https://github.com/python/cpython/pull/32019

___
Python tracker 

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



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9087243e2c167e38570e819b228efc3492c38c9c by Victor Stinner in 
branch 'main':
bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() (GH-32018)
https://github.com/python/cpython/commit/9087243e2c167e38570e819b228efc3492c38c9c


--

___
Python tracker 

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



[issue47073] Solution for recursion error when comparing dataclass objects

2022-03-20 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30106
pull_request: https://github.com/python/cpython/pull/32018

___
Python tracker 

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



[issue46126] Unittest output drives developers to avoid docstrings

2022-03-20 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

In an attempt to replicate Terry's usage, I added the following patch:

```
diff --git a/Lib/idlelib/idle_test/test_text.py 
b/Lib/idlelib/idle_test/test_text.py
index 0f31179e04..be977bbfff 100644
--- a/Lib/idlelib/idle_test/test_text.py
+++ b/Lib/idlelib/idle_test/test_text.py
@@ -20,6 +20,10 @@ def test_init(self):
 self.assertEqual(self.text.get('end'), '')
 
 def test_index_empty(self):
+"""
+Failing test with bad description.
+"""
+raise ValueError()
 index = self.text.index
 
 for dex in (-1.0, 0.3, '1.-1', '1.0', '1.0 lineend', '1.end', '1.33',
```

When I did, I then ran the tests using the `-m` launcher:

```
$ ./python.exe -m test.test_idle -v -k test_index_empty
idlelib.idle_test.test_configdialog (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_debugger (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_editmenu (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_help (unittest.loader.ModuleSkipped) ... skipped 'cannot 
run without OS X gui process'
idlelib.idle_test.test_parenmatch (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_percolator (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_replace (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_scrolledlist (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_search (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
test_index_empty (idlelib.idle_test.test_text.MockTextTest)
Failing test with bad description. ... ERROR
setUpClass (idlelib.idle_test.test_text.TkTextTest) ... skipped 'cannot run 
without OS X gui process'
idlelib.idle_test.test_textview (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_tooltip (unittest.loader.ModuleSkipped) ... skipped 
'cannot run without OS X gui process'
idlelib.idle_test.test_tree (unittest.loader.ModuleSkipped) ... skipped 'cannot 
run without OS X gui process'
idlelib.idle_test.test_undo (unittest.loader.ModuleSkipped) ... skipped 'cannot 
run without OS X gui process'

==
ERROR: test_index_empty (idlelib.idle_test.test_text.MockTextTest)
Failing test with bad description.
--
Traceback (most recent call last):
  File "/Users/jaraco/code/public/cpython/Lib/idlelib/idle_test/test_text.py", 
line 26, in test_index_empty
raise ValueError()
^^
ValueError

--
Ran 14 tests in 0.001s

FAILED (errors=1, skipped=14)
```

As you can see, the location of the failing test in the log is masked, and 
instead the description is present.

I've pushed 
https://github.com/python/cpython/tree/bpo-46126/disable-descriptions-unittest-m,
 which when applied disables the descriptions.

This approach works as a surgical intervention, wrapping `unittest.main` in 
such a way that it could be replaced across the test suite to disable 
descriptions. By subclassing the TextTestRunner, it continues to honor other 
parameters from the command-line (such as verbosity).

Terry, would you review the concept? Does it meet your needs? If so, I can 
apply it more broadly and prepare a PR.

--
assignee: jaraco -> terry.reedy

___
Python tracker 

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



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 332b04bac35cd7305c60da2d5733940dc089949a by Victor Stinner in 
branch 'main':
bpo-46850: Remove _PyEval_SetAsyncGenFinalizer() (GH-32017)
https://github.com/python/cpython/commit/332b04bac35cd7305c60da2d5733940dc089949a


--

___
Python tracker 

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



[issue47026] BytesWarning in zipimport paths on sys.path

2022-03-20 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

This warning can be fixed by changing the following line:

https://github.com/python/cpython/blob/9d1c4d69dbc800ac344565119337fcf490cdc800/Lib/importlib/_bootstrap_external.py#L1419

to:

if not path and str(path) == '':

and running `make regen-importlib; make`

Alternatively the change can be:

if not path and isinstance(path, (str,bytes)):

I'm not sure which is preferable or if some other fix would be better (I don't 
know much about importlib).

===
Adding Brett as the expert -- Brett, can you take a look?

Adding a full traceback with -bb argument:

Traceback (most recent call last):
  File "/Users/ak/temp2/zipfile_demo.py", line 29, in 
sys.exit(main())
 ^^
  File "/Users/ak/opensource/cpython4/Lib/contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
^
  File "/Users/ak/temp2/zipfile_demo.py", line 12, in _tmp_path
yield pathlib.Path(tmp_dir)
^^^
  File "/Users/ak/temp2/zipfile_demo.py", line 24, in main
import module
^
  File "", line 1178, in _find_and_load
  File "", line 1140, in _find_and_load_unlocked
  File "", line 1080, in _find_spec
  File "", line 1493, in find_spec
  File "", line 1462, in _get_spec
  File "", line 1418, in 
_path_importer_cache
BytesWarning: Comparison between bytes and string

--
nosy: +andrei.avk, brett.cannon

___
Python tracker 

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



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30105
pull_request: https://github.com/python/cpython/pull/32017

___
Python tracker 

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



[issue47073] Solution for recursion error when comparing dataclass objects

2022-03-20 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +eric.smith

___
Python tracker 

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



[issue35967] Better platform.processor support

2022-03-20 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy:  -yan12125

___
Python tracker 

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



[issue47055] `issubclass` on two different subclasses of abstract base class like `os.PathLike` returns unexpected value on early versions of Py3.7 and Py3.8

2022-03-20 Thread mobiusklein


mobiusklein  added the comment:

Understood. It's probably good practice to keep the interpreter version up to 
date in any case when debugging.

--
resolution:  -> works for me
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



[issue47073] Solution for recursion error when comparing dataclass objects

2022-03-20 Thread Yonatan Dankner


New submission from Yonatan Dankner :

TL;DR: A possible method to avoid infinite recursion when comparing dataclasses 
with circular references, using a decorator.

>>> @dataclass
... class A:
... x: int = 1
... self_reference: Any = field(init=False)
...
... def __post_init__(self):
... self.self_reference = self
...
>>> A(x=1) == A(x=1)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in __eq__
  File "", line 3, in __eq__
  File "", line 3, in __eq__
  [Previous line repeated 330 more times]
RecursionError: maximum recursion depth exceeded in comparison

It should in my opinion return True.

To avoid a recursion error, I would like to suggest a solution using a wrapper, 
similar to the one implemented for repr (see dataclasses._recursive_repr):
If within the process of comparing two objects, we have encountered an attempt 
to compare these objects (meaning we have reached a loop), we should return 
true, since no inequalities will be discovered if we continue recursing.

I suggest an addition to dataclasses.py which would look something like this 
(drew inspiration from _recursive_repr):

def _recursive_eq(user_function):
# Decorator to make a eq function return True when a loop was detected.
eq_running = set()

@functools.wraps(user_function)
def wrapper(self, other):
key = id(self), id(other), _thread.get_ident()
if key in eq_running:
return True
eq_running.add(key)
   
try:
result = user_function(self, other)
finally:
eq_running.discard(key)
return result
return wrapper


# And then replacing the _cmp_fn with the following.

def _cmp_fn(name, op, self_tuple, other_tuple):
return _recursive_eq(_create_fn(name,
  ('self', 'other'),
  [ 'if other.__class__ is self.__class__:',
   f' return {self_tuple}{op}{other_tuple}',
'return NotImplemented']))

I would like to hear your thoughts!

--
components: Library (Lib)
messages: 415641
nosy: dankner
priority: normal
severity: normal
status: open
title: Solution for recursion error when comparing dataclass objects
type: behavior
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



[issue46965] Enable informing callee it's awaited via vector call flag

2022-03-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

I will wait until there is a draft PR to review, or until you ping me.--
--Guido (mobile)

--

___
Python tracker 

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



[issue47031] math.nan should note that NANs do not compare equal to anything

2022-03-20 Thread Stanley


Stanley  added the comment:

Vedran's got a good point, as existing documentation for math.nan already says

"... Equivalent to the output of float('nan')."

so it does seem a bit redundant to say both, though I wonder if we should still 
be explicit since

>>> import math
>>> math.nan is math.nan
True
>>> float('nan') is float('nan')
False

so they don't have the exact same behavior.

Serhiy also has a good point, so maybe instead say that Math.nan/float('nan') 
is *generally* not equal to any other value?

--

___
Python tracker 

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



[issue45297] Improve the IDLE shell save command

2022-03-20 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Here is another example of a newbie caught by this:

https://discuss.python.org/t/syntax-error-in-python-3-10-when-running-on-terminal/14462

--

___
Python tracker 

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



[issue33028] [doc] tempfile.TemporaryDirectory documentation improvements

2022-03-20 Thread Stanley


Change by Stanley :


--
keywords: +patch
nosy: +slateny
nosy_count: 4.0 -> 5.0
pull_requests: +30104
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32016

___
Python tracker 

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



[issue47006] PEP 646: Decide on substitution behavior

2022-03-20 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

It's simple if you only look at simple examples.

Here are some examples current main (with Serhiy's patch for the Python version 
of typing) gets wrong:

>>> from typing import *
>>> Ts = TypeVarTuple("Ts")
>>> T1 = TypeVar("T1")
>>> T2 = TypeVar("T2")
>>> Tuple[T1, Unpack[Ts], T2][int, Unpack[tuple[int]]]  # expect error
typing.Tuple[int, *tuple[int]]
>>> Tuple[T1, Unpack[Ts], str, T2][int, Unpack[Ts]]  # expect error (T2 missing)
typing.Tuple[int, str, *Ts]  # it put *Ts in the wrong place
>>> Tuple[T1, Unpack[Ts], str, T2][int, Unpack[Ts], Unpack[Ts]]  # expect error 
>>> (*Ts can't substitute T2)
typing.Tuple[int, *Ts, str, *Ts]
>>> class G(Generic[T1, Unpack[Ts], T2]): pass
... 
>>> G[int]  # expect error
__main__.G[int]

We can probably fix that, but I'm not looking forward to implementing the fixed 
logic in both Python and C. Also, I'm worried that it won't work with future 
extensions to the type system (e.g., the rumored Map operator) that may go into 
3.12 or later versions.

--

___
Python tracker 

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



[issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32

2022-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +30103
pull_request: https://github.com/python/cpython/pull/32015

___
Python tracker 

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



[issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32

2022-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 4c989e19c84ec224655bbbde9422e16d4a838a80 by Gregory P. Smith in 
branch '3.10':
[3.10] bpo-38256: Fix binascii.crc32 large input. (GH-32000) (GH-32013)
https://github.com/python/cpython/commit/4c989e19c84ec224655bbbde9422e16d4a838a80


--

___
Python tracker 

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



[issue47064] thread QOS attribute on macOS

2022-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Definitely not an OS specific concept.  Big.little configs are all over the 
place on all OSes and architectures these days.  With a variety of ways OSes 
are experimenting with scheduling for them (nevermind that Android and iOS have 
been doing this for a decade).

from scheduling policies such as users, cgroup membership, container 
membership, group membership, nice level, to QoS attributes as you mention 
here...

If a given OS has specific APIs we should expose them via the os or _thread 
modules as appropriate.  But unless multiple OSes congeal around common 
concepts, there isn't much we can do for abstraction.  Perhaps a generic way to 
supply a generic OS specific settings instance to threading.Thread for 
implementation defined configuration purposes before Thread.start() is called.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue47065] test_curses fails if terminal defaults to bright white text (15)

2022-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

can we reliably query for what the default is and add that to the expectations? 
 or just skip the test if the defaults don't match our expectations (less 
ideal)?

if those are a challenge to do reliably - adding 15, 0 to the expected set may 
be the most practical.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue47054] "SyntaxError: non-default argument follows default argument" confuses

2022-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue47054] "SyntaxError: non-default argument follows default argument" confuses

2022-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +patch
nosy: +gregory.p.smith
nosy_count: 4.0 -> 5.0
pull_requests: +30102
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32014

___
Python tracker 

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



[issue46125] Test the preferred API instead of relying on legacy for coverage

2022-03-20 Thread Jason R. Coombs


Change by Jason R. Coombs :


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



[issue35967] Better platform.processor support

2022-03-20 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I'm going to close this issue again, as the implementation is now present in at 
least a couple of releases. May I suggest that if there are ongoing concerns or 
issues to open up a new issue and reference this one and loop me into the 
conversation? I'm also happy to re-open this one as well.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue25489] sys.exit() caught in async event loop exception handler

2022-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
title: sys.exit() caught in exception handler -> sys.exit() caught in async 
event loop exception handler

___
Python tracker 

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



[issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd

2022-03-20 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 94f038cbb27dc6d1a74ae2bfedea674911f8e8c6 by Hugo van Kemenade in 
branch '3.10':
[3.10] bpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 
(GH-31891) (#31997)
https://github.com/python/cpython/commit/94f038cbb27dc6d1a74ae2bfedea674911f8e8c6


--
nosy: +asvetlov

___
Python tracker 

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



[issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32

2022-03-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +30101
pull_request: https://github.com/python/cpython/pull/32013

___
Python tracker 

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



[issue39971] [doc] Error in functional how-to example

2022-03-20 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
title: Error in functional how-to example -> [doc] Error in functional how-to 
example
versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__

2022-03-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 
3.7

___
Python tracker 

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



[issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__

2022-03-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue46774] Importlib.metadata.version picks first distribution not latest

2022-03-20 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Closing without prejudice. Happy to revisit if there's more information on how 
importlib could/should behave differently.

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



[issue47060] importlib.metadata.version can return None

2022-03-20 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
assignee:  -> jaraco

___
Python tracker 

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



[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I profiled dict[str, int](a=1, b=2), and it looks like a decent chunk of time 
comes from PyUnicode_New as used by PyObject_SetAttrString.

You could also try replacing PyObject_SetAttrString with PyObject_SetAttr and 
adding "__orig_class__" to the global strings with 
Tools/scripts/generate_global_objects.py, probably for a later PR.

--

___
Python tracker 

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



[issue33028] [doc] tempfile.TemporaryDirectory documentation improvements

2022-03-20 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
title: tempfile.TemporaryDirectory incorrectly documented -> [doc] 
tempfile.TemporaryDirectory documentation improvements
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 
3.8

___
Python tracker 

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



[issue34406] Typo in documentation

2022-03-20 Thread Irit Katriel


Irit Katriel  added the comment:

This has been fixed by now.

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



[issue42871] Regex compilation crashed if I change order of alternatives under quantifier

2022-03-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue38256] binascii.crc32 is not 64-bit clean when USE_ZLIB_CRC32

2022-03-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 9d1c4d69dbc800ac344565119337fcf490cdc800 by Gregory P. Smith in 
branch 'main':
bpo-38256: Fix binascii.crc32() when inputs are 4+GiB (GH-32000)
https://github.com/python/cpython/commit/9d1c4d69dbc800ac344565119337fcf490cdc800


--

___
Python tracker 

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



[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2022-03-20 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood, JelleZijlstra

___
Python tracker 

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



[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2022-03-20 Thread Anton Agestam


Anton Agestam  added the comment:

As a consumer of `get_type_hints()` I think it'd be valuable to even have 
partially resolved types. My use case is that I provide an `Annotated` alias 
with a marker, and all I care about when inspecting user type hints is whether 
or not the arguments of an `Annotated` type contains my marker object. So 
ideally the fallback to an unresolved string or a sentinel object such as the 
proposed `typing.Unresolvable` should happen at the "lowest resolvable level" 
so that what can be resolved isn't lost.


By example, I'm saying that I think that this code:

marker = object()

def dec(cls):
print(get_type_hints(cls))
return cls

@dec
class A(abc.ABC):
forward: Annotated[B, marker]

class B:
...

Should produce:

{"forward": Annotated[Unresolvable["B"], marker]}

I guess this would apply in situations where for instance a part of a union 
isn't resolvable too. If we have a union A|B where A is resolvable and B isn't, 
it should be resolved to:

A | Unresolvable["B"]

And not to:

Unresolvable["A | B"]

(I think for this perspective it's irrelevant whether unresolved types have a 
sentinel type or are just represented as strings).

(Here's the library that's my use case for the curious: 
https://github.com/antonagestam/abcattrs)

--
nosy: +antonagestam

___
Python tracker 

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



[issue47051] Windows v3.10.3 .chm file (in python310\doc) page headings are messed up and spread out over several lines. Also the font has changed from the former san serif font to a smaller and harde

2022-03-20 Thread Ned Deily


Change by Ned Deily :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue37789] Update doc strings for test.bytecode_helper

2022-03-20 Thread Irit Katriel


Irit Katriel  added the comment:

This has been fixed by now.

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



[issue47072] Database corruption with the shelve module

2022-03-20 Thread Hubert Tournier


New submission from Hubert Tournier :

After adding a few records, the shelve module corrupts the database keys (the 
database is still readable if an element key is known, but no more iterable):

Traceback (most recent call last):
  File "./shelve-test.py", line 81, in 
_verify_whois_cache()
  File "./shelve-test.py", line 61, in _verify_whois_cache
for key in db.keys():
  File "/usr/local/lib/python3.8/_collections_abc.py", line 720, in __iter__
yield from self._mapping
  File "/usr/local/lib/python3.8/shelve.py", line 95, in __iter__
for k in self.dict.keys():
SystemError: Negative size passed to PyBytes_FromStringAndSize

I provide a short test program and data that systematically reproduces the bug. 
I added the a script showing execution messages, the resulting database in DB 
and text formats.

Tested with Python 3.8.12 on FreeBSD 13.0-RELEASE-p8.
I suppose Python is using my system package db5-5.3.28_8   
(Oracle Berkeley DB, revision 5.3).

See also similar issues:
https://bugs.python.org/issue33074
https://bugs.python.org/issue30388

--
components: Library (Lib)
files: shelve-test.zip
messages: 415625
nosy: HubTou
priority: normal
severity: normal
status: open
title: Database corruption with the shelve module
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50693/shelve-test.zip

___
Python tracker 

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



[issue47064] thread QOS attribute on macOS

2022-03-20 Thread Dong-hee Na


Dong-hee Na  added the comment:

> I'd be more interested in trying to implement the same interface on other 
> platforms using the low-level APIs for those platforms

Yeah, I am on the same line, I prefer to provide the interface that the user 
actually doesn't care about implementation detail.

But it looks hard to map to priority policy.
A similar discussion from the Ruby team:
https://bugs.ruby-lang.org/issues/17566

--

___
Python tracker 

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



[issue46965] Enable informing callee it's awaited via vector call flag

2022-03-20 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue47006] PEP 646: Decide on substitution behavior

2022-03-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think I'm with Serhiy, I don't understand the hesitance to transform 
tuple[*Ts][int, str] into tuple[int, str].

What would be an example of a substitution that's too complex to do?

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2022-03-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

With python built from main I get:

/Users/guido/test_sys_exit_in_exception_handler.py:12: DeprecationWarning: 
There is no current event loop
  loop = asyncio.get_event_loop()
Got error, exiting
Exception ignored in: >
Traceback (most recent call last):
  File "/Users/guido/cpython/Lib/asyncio/base_events.py", line 1749, in 
call_exception_handler
self._exception_handler(self, context)
^^
  File "/Users/guido/test_sys_exit_in_exception_handler.py", line 6, in handler
sys.exit(42)

SystemExit: 42


This is printed from write_unraisable_exc_file(). Earlier comments in this 
issue indicate that the exception is being raised from a finalizer (__del__ 
method). But how?

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2022-03-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

Nevertheless, the example code still hangs after calling sys.exit(). I can't 
quite tell where it is hanging.

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2022-03-20 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

The change exists since Python 3.8 (October of 2019)
The issue discussion belongs to 2015

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2022-03-20 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Not sure if the issue is still relevant.
asyncio re-raises KeyboardInterrupt explicitly in all 
loop.call_exception_handler() branches: 
https://github.com/python/cpython/blob/main/Lib/asyncio/base_events.py#L1759-L1814

--

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2022-03-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2022-03-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

Andrew, would you be interested in investigating this? I can't even follow the 
flow through asyncio that causes the observed behavior (though I seem to have 
confirmed it).

--
nosy: +asvetlov

___
Python tracker 

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



[issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening

2022-03-20 Thread Erik Soma


Erik Soma  added the comment:

Certainly: https://github.com/python/cpython/pull/32011

--

___
Python tracker 

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



[issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening

2022-03-20 Thread Erik Soma


Change by Erik Soma :


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

___
Python tracker 

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



[issue42658] os.path.normcase() is inconsistent with Windows file system

2022-03-20 Thread AN Long


Change by AN Long :


--
keywords: +patch
nosy: +asaka
nosy_count: 7.0 -> 8.0
pull_requests: +30098
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32010

___
Python tracker 

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



[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread Guido van Rossum


Guido van Rossum  added the comment:

@Dennis, if/when the PR looks good to you, you can merge it.

--

___
Python tracker 

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



[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread penguin_wwy


penguin_wwy <940375...@qq.com> added the comment:

There is a small problem with the example:

```
d = dict[int]
```

should

```
d = dict[str, int]
```

--

___
Python tracker 

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



[issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening

2022-03-20 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks for the report.
Could you make a pull request?
The whole attached windows_events.py is hard to analyze.

--

___
Python tracker 

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



[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +JelleZijlstra, gvanrossum, kj

___
Python tracker 

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



[issue47067] Add vectorcall for generica alias object

2022-03-20 Thread penguin_wwy

penguin_wwy <940375...@qq.com> added the comment:

The point of bpo-40369 issue seems to be to provide vectorcall to the 
`GenericAliasType`, means vectorcall for `Queue[int]`

However, my idea is to add vectorcall to gaobject, like this:

```
d = dict[int]
d(a=1, b=2) <-- vectorcall
```

The idea came from my desire to implement different subclasses of a type when 
implementing some kind of factory model:

```
class ChildClassBuilder:
...

def set_type(self, t: Type):
self.t = t

def build():
instance = self.t()
...
return instance
```

In the case of high type-hint coverage, the `self.t` is often a gaobject.

Benchmark example:
```
def test():
d = dict[int]
for _ in range(100):
d(a=1, b=2)
```

Speedup 20% in my wsl2
```
opt:
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
10.0000.0001.7281.728 :1()
11.7281.7281.7281.728 test.py:4(test)

master:
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
10.0000.0002.2712.271 :1()
12.2712.2712.2712.271 test.py:4(test)
```

--

___
Python tracker 

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



[issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening

2022-03-20 Thread Erik Soma


Erik Soma  added the comment:

Uploading my hack to `asyncio.windows_events.py` -- this is based off 3.10.2's 
distribution.

--
Added file: https://bugs.python.org/file50692/windows_events.py

___
Python tracker 

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



[issue47071] asyncio proactor udp transport stops responding after send to port that isn't listening

2022-03-20 Thread Erik Soma


New submission from Erik Soma :

Reproducer attached. Change `USE_PROACTOR` to `False` to use the 
`SelectorEventLoop` instead, which doesn't exhibit this behavior.

The output on my machine when using the proactor loop is:
```
datagram received b'ping 1'
datagram received b'ping 2'
```

And the selector loop (which is the behavior I would expect):
```
datagram received b'ping 1'
datagram received b'ping 2'
datagram received b'ping 3'
```


At a high level, after sending data to an address that isn't listening the 
asyncio protocol will no longer receive messages.


Digging deeper, `_ProactorDatagramTransport._loop_reading` encounters the 
windows error 1234 (ERROR_PORT_UNREACHABLE) after the "bad send". It appears 
this a (undocumented/buggy?) behavior of `WSARecvFrom` where the next call to 
it after an unreachable `WSASendTo` in UDP mode will return the ICMP 
unreachable message. The actual error is returned from `GetOverlappedResult`.


I've hacked together a fix that retries `IocpProactor.recvfrom` if the result 
is ERROR_PORT_UNREACHABLE. It fixes the issue for the reproducer and my actual 
use case, but it's probably not ideal. My solution for the moment is just to 
use the SelectorEventLoop instead.

--
components: Windows, asyncio
files: udpbug2.py
messages: 415611
nosy: asvetlov, esoma, paul.moore, steve.dower, tim.golden, yselivanov, 
zach.ware
priority: normal
severity: normal
status: open
title: asyncio proactor udp transport stops responding after send to port that 
isn't listening
versions: Python 3.10
Added file: https://bugs.python.org/file50691/udpbug2.py

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2022-03-20 Thread miss-islington


miss-islington  added the comment:


New changeset 4aa8b802513340d12a6ffea3d5e2228ac6c7d5b8 by Miss Islington (bot) 
in branch '3.9':
bpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-26974)
https://github.com/python/cpython/commit/4aa8b802513340d12a6ffea3d5e2228ac6c7d5b8


--

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2022-03-20 Thread miss-islington


miss-islington  added the comment:


New changeset 4352ca234e979ad1c7158981addf899b119cd448 by Miss Islington (bot) 
in branch '3.10':
bpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-26974)
https://github.com/python/cpython/commit/4352ca234e979ad1c7158981addf899b119cd448


--

___
Python tracker 

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



[issue47015] Update tests from asyncore to asyncio

2022-03-20 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue47015] Update tests from asyncore to asyncio

2022-03-20 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 3ae975f1ac880c47d51cca6c9e305547bd365be7 by Oleg Iarygin in 
branch 'main':
bpo-47015: Update test_os from asyncore to asyncio (GH-31876)
https://github.com/python/cpython/commit/3ae975f1ac880c47d51cca6c9e305547bd365be7


--

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2022-03-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30097
pull_request: https://github.com/python/cpython/pull/32009

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2022-03-20 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +30096
pull_request: https://github.com/python/cpython/pull/32008

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2022-03-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e730ae7effe4f13b24f1b5fb1fca005709c86acb by Kevin Mehall in 
branch 'main':
bpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-26974)
https://github.com/python/cpython/commit/e730ae7effe4f13b24f1b5fb1fca005709c86acb


--

___
Python tracker 

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



[issue43902] ssl module: add getter for SSL_CTX* and SSL*

2022-03-20 Thread Hans-Christoph Steiner


Hans-Christoph Steiner  added the comment:

This general idea sounds nice to have, I hope it can be included.  
`ctx._call_with_ctypes("SSL_CTX_set_ciphersuites"...` also sounds totally 
workable to me, if that has the best security profile.

Defense in depth is important, but it is not a reason to prevent key 
functionality from landing.  For example, "export_keying_material" is an RFC 
and widely implemented (Go crypto/tls, Rustls, Conscrypt, nodejs, boringssl, 
openssl, BouncyCastle, etc see links here 
https://github.com/python/cpython/pull/25255#issuecomment-1073256270).  It is 
used in IETF protocols like SRTP and NTS.

Perhaps that could be a concrete use case here for thinking about the security 
profile?

--
nosy: +eighthave

___
Python tracker 

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



[issue28080] Allow reading member names with bogus encodings in zipfile

2022-03-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I experimented with this a lot. There is a problem with the append mode. We can 
read in the append mode, therefore we need an encoding. But when we close a 
ZipFile after appending, non-ASCII file names will be encoded in UTF-8 in the 
central directory. Next time when we open the archive for reading with 
different encoding we will get an error because filenames in the central 
directory and in local headers are different. We need to write non-ASCII files 
back with the specified encoding to get a self-consistent data.

Finally I left this as it was initially. We can return to the problem with the 
append module later.

The differences between PR 32007 and your patches:

* The parameter was renamed to metadata_encoding to avoid confusion with 
existing parameter of ZipFile.open() encoding. In future I am going to use it 
also for comments. The attribute and the CLI option were renamed 
correspondingly.
* --metadata-encoding can also be used with the -t option.
* "surrogateescape" no longer used. If the encoding in not suitable, you will 
get an error. Use the default and decode filenames manually in such cases. We 
can change this in future.
* Updated documentation.
* Tests were significantly rewritten. Now they test the behavior with wrong 
metadata_encoding, mixed UTF-8 and legacy encodings, and reading after append.

I was going to make more changes, but left it for future.

--
versions: +Python 3.11 -Python 3.7

___
Python tracker 

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



[issue37952] Add support for export_keying_material to SSL library

2022-03-20 Thread Hans-Christoph Steiner


Hans-Christoph Steiner  added the comment:

I understand the frustrations here, but this is really not a place to vent, 
since that only harms everyone's interests.  When a core maintainer voices 
concerns or questions, they need to be addressed.  This goes for any project.

I'll see if I can contribute to https://bugs.python.org/issue43902, that would 
also work for exporting keying material.

--

___
Python tracker 

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



[issue28080] Allow reading member names with bogus encodings in zipfile

2022-03-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +30095
pull_request: https://github.com/python/cpython/pull/32007

___
Python tracker 

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



[issue46013] Confusing period in object.__hash__ doc

2022-03-20 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



[issue46013] Confusing period in object.__hash__ doc

2022-03-20 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 504973a13336d8a4d20459f68de9647a1fb25966 by Miss Islington (bot) 
in branch '3.9':
bpo-46013: Fix confusing kerning on period in docs (GH-29989) (GH-32006)
https://github.com/python/cpython/commit/504973a13336d8a4d20459f68de9647a1fb25966


--

___
Python tracker 

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



[issue46013] Confusing period in object.__hash__ doc

2022-03-20 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 87b3e202d46cdeb0a6b1ef041579a5ebc7c826a9 by Miss Islington (bot) 
in branch '3.10':
bpo-46013: Fix confusing kerning on period in docs (GH-29989) (GH-32005)
https://github.com/python/cpython/commit/87b3e202d46cdeb0a6b1ef041579a5ebc7c826a9


--

___
Python tracker 

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



  1   2   >