[issue45669] An 'ascii_alphanumerics' variable is missing in the 'strings' lib

2021-10-29 Thread Dong-hee Na


Dong-hee Na  added the comment:

I always need to write trivial code to generate fixed-length random strings 
with ascii_alphanumerics.
It will solve similar usages and help a lot of packages.

--

___
Python tracker 

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



[issue45669] An 'ascii_alphanumerics' variable is missing in the 'strings' lib

2021-10-29 Thread Dong-hee Na


Dong-hee Na  added the comment:

+1 to me also

--
nosy: +corona10

___
Python tracker 

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



[issue45484] test_pickle segfault on s390x RHEL7 LTO 3.x

2021-10-29 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Looks like the pickletester bug hasn't happened since the fix, so I'll go ahead 
and close this.

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



[issue45420] Python 3.10 final installation failure

2021-10-29 Thread wyz23x2


wyz23x2  added the comment:

BTW, how does the installer detect whether if another version is installed?

--

___
Python tracker 

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



[issue45420] Python 3.10 final installation failure

2021-10-29 Thread wyz23x2


wyz23x2  added the comment:

I upgraded to Windows 11 _and_ deleted all Python 3.10 related installations in 
regedit. Still doesn't work :(

--

___
Python tracker 

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



[issue45671] str(CancelledError()) is empty

2021-10-29 Thread lilydjwg


lilydjwg  added the comment:

Oh, I find that many exceptions return an empty string when created without any 
arguments, but most raised ones do have a descriptive error message.

Yes, if it's going to change, we'd change all of them. But now I doubt if it's 
worth the effort... What if we change so that if the exception were going to 
return an empty string, it returns the class name instead?

--

___
Python tracker 

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



[issue2771] Test issue

2021-10-29 Thread Ezio Melotti


Ezio Melotti  added the comment:

Testing GitHub mentions, please ignore: @serhiy-storchaka

--

___
Python tracker 

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



[issue45669] An 'ascii_alphanumerics' variable is missing in the 'strings' lib

2021-10-29 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

I've found 81 occurrences of this pattern among 52 projects on a dataset of top 
PyPI packages (~3.5K). So I'd say +1 on including this.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue45677] [doc] improve sqlite3 docs

2021-10-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

What is wrong with addressing the reader as "you"?

Avoiding an affirmative tone goes directly against the style-guide you linked 
to, which recommends an affirmative (positive) tone:

"The documentation focuses on affirmatively stating what the language does..."

The alternative would be to take a negative tone, focusing on what the library 
doesn't do.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2021-10-29 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27596
pull_request: https://github.com/python/cpython/pull/29327

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2021-10-29 Thread miss-islington


miss-islington  added the comment:


New changeset 62bf263a775fd8b5d5841cc09be3bd53e933 by Erlend Egeberg 
Aasland in branch 'main':
bpo-10572: Move `sqlite3` tests to `Lib/test` (GH-29304)
https://github.com/python/cpython/commit/62bf263a775fd8b5d5841cc09be3bd53e933


--
nosy: +miss-islington

___
Python tracker 

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



[issue45674] From Python 3.7, sre_parse.parse() do not create SubPattern instances that can be used to back reproduce original expression if containing non-capturing groups

2021-10-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

sre_parse.parse() is an internal function and this behaviour is an 
implementation detail.

This change enabled some optimizations which did not work with non-capturing 
groups before. It did not affect the matching itself.

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



[issue45677] [doc] improve sqlite3 docs

2021-10-29 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue45677] [doc] improve sqlite3 docs

2021-10-29 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

The sqlite3 docs could need a little makeover. Here's some things that could be 
improved:

- avoid addressing the reader as "you"
- avoid using affirmative tone
- establish a "Security Considerations" or "Common Mistakes" section, instead 
of littering the docs with warnings


See also:
- https://devguide.python.org/documenting/#style-guide

--
assignee: docs@python
components: Documentation
messages: 405349
nosy: docs@python, erlendaasland
priority: normal
severity: normal
status: open
title: [doc] improve sqlite3 docs
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



[issue45582] Rewrite getpath.c in Python

2021-10-29 Thread Steve Dower


Steve Dower  added the comment:

So I think I've found my first completely unavoidable API break: 
PyConfig_Read(config) has to work before initialisation, but is also supposed 
to fill out all the fields (including the search path). But because we need at 
least an interpreter state, we now can't calculate everything.

The only test that seems to be affected here is 
test_embed.test_init_read_set(), which does a PyConfig_Read() and then inserts 
new paths into module_search_paths before initialising. With that one skipped, 
I think everything else can be handled.

--

___
Python tracker 

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



[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Erlend! ✨  ✨

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

___
Python tracker 

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



[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset ed807bf333cdc78b92c9861600acf1a435c52193 by Łukasz Langa in 
branch '3.9':
[3.9] bpo-45581: Raise `MemoryError` in `sqlite3.connect` if SQLite signals 
memory error (GH-29171) (GH-29324)
https://github.com/python/cpython/commit/ed807bf333cdc78b92c9861600acf1a435c52193


--

___
Python tracker 

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



[issue45379] Improve errors related to frozen modules.

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset c2d0ba722a7b3839685af968cf0c304a24cdf525 by Filipe Laíns in 
branch 'main':
bpo-45379: clarify FROZEN_EXCLUDED and FROZEN_INVALID documentation (GH-29189)
https://github.com/python/cpython/commit/c2d0ba722a7b3839685af968cf0c304a24cdf525


--

___
Python tracker 

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



[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 7e2c0a18b41cb906a354776e6ca52af81e39820f by Łukasz Langa in 
branch '3.10':
[3.10] bpo-45581: Raise `MemoryError` in `sqlite3.connect` if SQLite signals 
memory error (GH-29171) (GH-29323)
https://github.com/python/cpython/commit/7e2c0a18b41cb906a354776e6ca52af81e39820f


--

___
Python tracker 

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



[issue45600] First sentence in docs for os.environ

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Andrei! ✨  ✨

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

___
Python tracker 

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



[issue45600] First sentence in docs for os.environ

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 3ec1124de289496efabc43a02cc88b3c59e1e238 by Miss Islington (bot) 
in branch '3.9':
bpo-45600: Enhanced / clarified the docs for os.environ and os.environb 
(GH-29204) (GH-29321)
https://github.com/python/cpython/commit/3ec1124de289496efabc43a02cc88b3c59e1e238


--

___
Python tracker 

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



[issue45600] First sentence in docs for os.environ

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 0538351fcaa320e62cb4ef92ec629b7e24a73e9c by Miss Islington (bot) 
in branch '3.10':
bpo-45600: Enhanced / clarified the docs for os.environ and os.environb 
(GH-29204) (GH-29322)
https://github.com/python/cpython/commit/0538351fcaa320e62cb4ef92ec629b7e24a73e9c


--

___
Python tracker 

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



[issue45335] Default TIMESTAMP converter in sqlite3 ignores UTC offset

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

Based on the decision from Discourse, the current behavior has only been 
documented and the actual issue is "wontfix".

Thanks for pursuing this, Ian! ✨  ✨

--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
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



[issue45335] Default TIMESTAMP converter in sqlite3 ignores UTC offset

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e1560313d4d9bff8eba0f851ef325f7ee19f7ba9 by Miss Islington (bot) 
in branch '3.9':
bpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200) 
(GH-29320)
https://github.com/python/cpython/commit/e1560313d4d9bff8eba0f851ef325f7ee19f7ba9


--

___
Python tracker 

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



[issue45335] Default TIMESTAMP converter in sqlite3 ignores UTC offset

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8ea665c730cd86a321c558c012bef84f454efa4f by Miss Islington (bot) 
in branch '3.10':
bpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200) 
(GH-29319)
https://github.com/python/cpython/commit/8ea665c730cd86a321c558c012bef84f454efa4f


--

___
Python tracker 

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



[issue45577] Make `test_zoneinfo.py` to check all pickle protocols

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Nikita! ✨  ✨

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



[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-29 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +27594
pull_request: https://github.com/python/cpython/pull/29324

___
Python tracker 

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



[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-29 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +27593
pull_request: https://github.com/python/cpython/pull/29323

___
Python tracker 

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



[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e2e62b3808691e15fa44b883270023e42dcad958 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45581: Raise `MemoryError` in `sqlite3.connect` if SQLite signals memory 
error (GH-29171)
https://github.com/python/cpython/commit/e2e62b3808691e15fa44b883270023e42dcad958


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45600] First sentence in docs for os.environ

2021-10-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27592
pull_request: https://github.com/python/cpython/pull/29322

___
Python tracker 

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



[issue45600] First sentence in docs for os.environ

2021-10-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +27591
pull_request: https://github.com/python/cpython/pull/29321

___
Python tracker 

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



[issue45600] First sentence in docs for os.environ

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset b17cfd150f4dc2816975d304a71110a2d445eaf0 by andrei kulakov in 
branch 'main':
bpo-45600: Enhanced / clarified the docs for os.environ and os.environb 
(GH-29204)
https://github.com/python/cpython/commit/b17cfd150f4dc2816975d304a71110a2d445eaf0


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45335] Default TIMESTAMP converter in sqlite3 ignores UTC offset

2021-10-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27590
pull_request: https://github.com/python/cpython/pull/29320

___
Python tracker 

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



[issue45335] Default TIMESTAMP converter in sqlite3 ignores UTC offset

2021-10-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 3877fc02f7a8801ba5ce0e94b6075b3fdd9778d0 by Ian Fisher in branch 
'main':
bpo-45335: Add note to `sqlite3` docs about "timestamp" converter (GH-29200)
https://github.com/python/cpython/commit/3877fc02f7a8801ba5ce0e94b6075b3fdd9778d0


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45335] Default TIMESTAMP converter in sqlite3 ignores UTC offset

2021-10-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +27589
pull_request: https://github.com/python/cpython/pull/29319

___
Python tracker 

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



[issue45645] Deep recursion terminates script execution with no error (Windows, Python 3.9)

2021-10-29 Thread Eryk Sun


Eryk Sun  added the comment:

In theory, a crash could be prevented in most cases by setting a larger stack 
guarantee (i.e. region of guard pages) via SetThreadStackGuarantee() [1] and 
using a vectored exception handler [2]. The exception handler can set a flag in 
the thread state that indicates stack-overflow recovery is in progress and then 
return EXCEPTION_CONTINUE_EXECUTION. The guaranteed stack space will be 
available, but there are no guard pages, so another stack overflow in this 
context will crash with an access violation. The stack guarantee should be 
large enough to raise and unwind a RecursionError. As the stack unwinds, if the 
recovery flag is still set, try calling _resetstkoflw() [3] to restore the 
guard region. If it succeeds, clear the flag in the thread state.

For giggles, here's a toy example using ctypes:

import ctypes
import sys

kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
ucrt = ctypes.CDLL('ucrtbase', use_errno=True)

EXCEPTION_CONTINUE_EXECUTION = 0x

stack_overflow = False

@ctypes.WINFUNCTYPE(ctypes.c_long, ctypes.c_void_p)
def handler(p):
global stack_overflow
stack_overflow = True
return EXCEPTION_CONTINUE_EXECUTION

kernel32.AddVectoredExceptionHandler(1, handler)

def recursive():
if stack_overflow:
raise RecursionError
recursive()

# Normally the stack has 2 or 3 guard pages, which is actually
# enough to recover in this example, but let's increase it to
# 9 pages (8 plus an extra that the memory manager adds). You
# can inspect this with Sysinternals VMMap.
size = ctypes.c_ulong(8 * 4096)
kernel32.SetThreadStackGuarantee(ctypes.byref(size))

sys.setrecursionlimit(100)

for n in range(5):
try:
recursive()
except RecursionError:
if stack_overflow and ucrt._resetstkoflw():
stack_overflow = False
print("recovered from stack overflow:", n)

---
[1] 
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreadstackguarantee
[2] 
https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-addvectoredexceptionhandler
[3] 
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/resetstkoflw?view=msvc-160

--
nosy: +eryksun

___
Python tracker 

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



[issue45676] Enum: improve generics support

2021-10-29 Thread Ethan Furman


Change by Ethan Furman :


--
assignee: ethan.furman
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: Enum: improve generics support
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



[issue45675] pkgutil.get_data() doesn't add subpackages to parent packages when importing

2021-10-29 Thread Matt Wozniski


Matt Wozniski  added the comment:

The original case where I encountered this was with a namespace package, but 
the behavior appears to be the same for a subpackage of a regular package.

--
title: pkgutil.get_data() doesn't add subpackages to namespaces when importing 
-> pkgutil.get_data() doesn't add subpackages to parent packages when importing

___
Python tracker 

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



[issue45675] pkgutil.get_data() doesn't add subpackages to namespaces when importing

2021-10-29 Thread Matt Wozniski


New submission from Matt Wozniski :

If a module hasn't yet been imported, `pkgutil.get_data(pkg_name, data_file)` 
will import it, but when it does, it doesn't add the submodule to its parent 
package when the parent package is a PEP 420 implicit namespace package.

```
$ mkdir -p namespace/package
$ touch namespace/package/__init__.py
$ echo data >namespace/package/data_file
$ python3.10 -c 'import namespace.package, pkgutil; 
print(pkgutil.get_data("namespace.package", "data_file")); import namespace; 
print(namespace.package)'
b'data\n'

$ python3.10 -c 'import pkgutil; print(pkgutil.get_data("namespace.package", 
"data_file")); import namespace.package; import namespace; 
print(namespace.package)'
b'data\n'
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: module 'namespace' has no attribute 'package'
$
```

In this reproducer, we've got an implicit namespace package called "namespace" 
and a regular package inside it called "namespace.package". The regular package 
has a data file called "data_file".

If we import the regular package and then call pkgutil.get_data() to access the 
data file, it successfully retrieves the data file, and the module object for 
the namespace package winds up with an attribute referencing the module object 
for the regular package.

If we call pkgutil.get_data() to access the data file before importing the 
regular package, it successfully retrieves the data file, but the module object 
for the namespace package doesn't have an attribute referencing the module 
object for the regular package, even if we later do a normal import for the 
regular package.

It looks like pkgutil is importing the module when it hasn't already been 
imported (which I would expect) and adding it and any parent packages to 
sys.modules (which I would also expect), but then not adding submodules as 
attributes to their parent modules like `import` would (which seems like a bug).

--
components: Library (Lib)
messages: 405331
nosy: godlygeek, pablogsal
priority: normal
severity: normal
status: open
title: pkgutil.get_data() doesn't add subpackages to namespaces when importing
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are

2021-10-29 Thread Nir Friedman


Nir Friedman  added the comment:

Wouldn't a nicer resolution for this be to change `iter` (which effectively 
defines what is "iterable"), so that if `iter` does not find the `__iter__` or 
sequence protocol, it then looks for the iterator protocol (`__next__`), and if 
it finds that, return the argument?

In that way, all iterators would automatically get the sane implementation of 
`__iter__` by default, and we could say that in the "runtime", all iterators 
are iterable, matching the types. And people wouldn't need to implement 
`__iter__` any more on their iterators i.e. the recommendation could simply be 
dropped).

--
nosy: +quicknir

___
Python tracker 

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



[issue45674] From Python 3.7, sre_parse.parse() do not create SubPattern instances that can be used to back reproduce original expression if containing non-capturing groups

2021-10-29 Thread Alex Waygood


Alex Waygood  added the comment:

Bugfixes are only being applied for Python >=3.9, but I've reproduced this 
output on 3.11

--
nosy: +AlexWaygood
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue45319] Possible regression in __annotations__ descr for heap type subclasses

2021-10-29 Thread Larry Hastings


Larry Hastings  added the comment:

I finally have some bandwidth to look at this--sorry for being a bit slow.

I wasn't able to reproduce, because the patch didn't apply cleanly.  I 
downloaded the patch ( 
https://patch-diff.githubusercontent.com/raw/GrahamDumpleton/wrapt/pull/187.patch
 ) and ran against current wrapt main, and about 50% of the "hunks" failed to 
apply.

--

___
Python tracker 

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



[issue45633] Py_GT listed twice in Doc/extending/newtypes.rst

2021-10-29 Thread Dmitry Smirnov


Change by Dmitry Smirnov :


--
keywords: +patch
nosy: +dmitrysmirnov931
nosy_count: 2.0 -> 3.0
pull_requests: +27588
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29318

___
Python tracker 

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



[issue45674] From Python 3.7, sre_parse.parse() do not create SubPattern instances that can be used to back reproduce original expression if containing non-capturing groups

2021-10-29 Thread Tristan


New submission from Tristan :

>From Python 3.7, sre_parse.parse() do not create SubPattern instances that can 
>be used to back reproduce original expression if containing non-capturing 
>groups. 

In Python 3.6: 

>>> import sre_parse
>>> sre_parse.parse("(?:foo (?:bar) | (?:baz))").dump()
SUBPATTERN None 0 0
  BRANCH
LITERAL 102
LITERAL 111
LITERAL 111
LITERAL 32
SUBPATTERN None 0 0
  LITERAL 98
  LITERAL 97
  LITERAL 114
LITERAL 32
  OR
LITERAL 32
SUBPATTERN None 0 0
  LITERAL 98
  LITERAL 97
  LITERAL 122


In Python 3.7 and beyond: 

>>> import sre_parse
>>> sre_parse.parse("(?:foo (?:bar) | (?:baz))").dump()
BRANCH
  LITERAL 102
  LITERAL 111
  LITERAL 111
  LITERAL 32
  LITERAL 98
  LITERAL 97
  LITERAL 114
  LITERAL 32
OR
  LITERAL 32
  LITERAL 98
  LITERAL 97
  LITERAL 122

This behaviour is making it impossible to write a correct colorizer for regular 
expressions using the sre_parse module from Python 3.7. I'm not a regex expert, 
so I cannot say wether this change has any effect on the matching itself, but 
if I trust regex101, it will add a capturing group in the place of the 
non-capturing group.

--
components: Regular Expressions
messages: 405327
nosy: ezio.melotti, mrabarnett, tristanlatr
priority: normal
severity: normal
status: open
title: From Python 3.7, sre_parse.parse() do not create SubPattern instances 
that can be used to back reproduce original expression if containing 
non-capturing groups
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue45671] str(CancelledError()) is empty

2021-10-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Concur with Andrew.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45562] python -d creates lots of tokenizer messages

2021-10-29 Thread miss-islington


miss-islington  added the comment:


New changeset d8ca47c943c4ad396a9c70aff35bbbf4b1868876 by Miss Islington (bot) 
in branch '3.10':
bpo-45562: Ensure all tokenizer debug messages are printed to stderr (GH-29270)
https://github.com/python/cpython/commit/d8ca47c943c4ad396a9c70aff35bbbf4b1868876


--

___
Python tracker 

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



[issue45671] str(CancelledError()) is empty

2021-10-29 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I don't think that we need to change something with the current behavior.

It exists for years; very many Python exceptions return an empty string on 
`str(exc)` but return something useful on `repr(exc)`.

If you arguing to change the behavior -- all such exceptions should be changed, 
not CancelledError only.

--

___
Python tracker 

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



[issue45535] Enum's dir() does not contain inherited members

2021-10-29 Thread Alex Waygood


Alex Waygood  added the comment:

I would argue it's quite important for `IntEnum` to have the dunder methods 
inherited from `int` show up in `help()`. Dunder methods indicate that an 
object has certain behaviours, so it's important for a user to be able to 
verify that an `IntEnum` member has similar behaviours to an `int` instance. 
`IntEnum` is advertised in the documentation as something that can be used 
everywhere where an integer is expected; it's surprising when the output from 
`help()` is hugely abbreviated for `IntEnum` relative to `int`.

But, I agree that my first draft of this PR is more complex than I'd like it to 
be.

--

___
Python tracker 

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



[issue45673] argparse error with option with optional value

2021-10-29 Thread Paolo Benvenuto


New submission from Paolo Benvenuto :

I'm using argparse with this code:

parser = argparse.ArgumentParser(
description='Scan a media tree in order to generate cache files suitable 
for showing a beautiful web gallery',
  )
  parser.add_argument(
"config_file_or_album_path",
help="the config file, if it's the only positional argument, or the album 
path, if two positional arguments are supplied"
  )
  parser.add_argument(
"cache_path",
nargs="?",
default="",
help="the cache path, if two positional arguments are supplied; otherwise, 
nothing"
  )
  parser.add_argument(
"-s",
"--periodic-save",
nargs="?",
type=int,
const=5,
default=0,
dest="periodic_save",
metavar="MINUTES",
help="runs the scanner in a more robust way, saving json files every X 
minutes, where X is the value given, or 5 if no value is given; 0 means non 
autosaving"
  )
  parser.add_argument(
"-j",
"--recreate-json-files",
action='store_true',
dest="recreate_json_files",
help="completely recreate the json files cache"
  )
  parser.add_argument(
"-r",
"--recreate-reduced-photos",
action='store_true',
dest="recreate_reduced_photos",
help="completely recreate reduced photo cache files"
  )
  parser.add_argument(
"-t",
"--recreate-thumbnails",
action='store_true',
dest="recreate_thumbnails",
help="completely recreate thumbnail cache files"
  )
  parser.add_argument(
"-v",
"--recreate-transcoded-videos",
action='store_true',
dest="recreate_transcoded_videos",
help="completely recreate transcoded video cache files"
  )
  parser.add_argument(
"-a",
"--recreate-all",
action='store_true',
dest="recreate_all",
help="completely recreate the cache: json files, reduced photos, thumbnails 
and transcoded videos; same as -jrtv"
  )
  parser.add_argument("--version", action="version", version='%(prog)s v5.3.10')
  args = parser.parse_args()

Running the app without parameter gives me:

$ myapp
usage: scanner [-h] [-s [MINUTES]] [-j] [-r] [-t] [-v] [-a] [--version] 
config_file_or_album_path [cache_path]
myapp: error: the following arguments are required: config_file_or_album_path

(the last line doesn't matter here, a required parameter is missing).

The -s option is optional and has an optional value, but:

$ myapp -s myfile
usage: scanner [-h] [-s [MINUTES]] [-j] [-r] [-t] [-v] [-a] [--version] 
config_file_or_album_path [cache_path]
scanner: error: argument -s/--periodic-save: invalid int value: '/my/file'

I'm expecting that, since there is a mandatory positional argument, myfile is 
interpreted as such, and only after that, -s is recognized as the optional 
argument without value.

--
components: Library (Lib)
messages: 405322
nosy: paolobenve
priority: normal
severity: normal
status: open
title: argparse error with option with optional value
type: behavior
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



[issue45672] Mutation tests results of typing.py

2021-10-29 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

I can send a PR to have 100% mutation coverage for `typing.py`.
I think that a single test can do that.

--

___
Python tracker 

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



[issue45535] Enum's dir() does not contain inherited members

2021-10-29 Thread Ethan Furman


Ethan Furman  added the comment:

Enums have had a custom dir() from the beginning, partly because they are not 
standard objects and do not follow standard rules.

The question posed by this issue is whether Enums with mixed-in data types 
should show the inherited methods, and if yes, should it also show inherited 
`__dunders__`.

I'm inclined to say yes for the normal inherited methods, I'm not sure about 
inherited `__dunders__`.

--

___
Python tracker 

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



[issue45672] Mutation tests results of typing.py

2021-10-29 Thread Nikita Sobolev


New submission from Nikita Sobolev :

I've decided to test `typing.py` with `cosmic-ray` mutation testing framework. 
It identified 3 potential problems.

Config:

```
[cosmic-ray]
module-path = "Lib/typing.py"
timeout = 15.0
excluded-modules = []
test-command = "./python.exe -m test -v test_typing --failfast"

[cosmic-ray.distributor]
name = "local"
```

Repro steps:
0. pip install cosmic-ray
1. Copy config above as `typing.toml`
2. cosmic-ray init typing.toml typing.sqlite
3. cosmic-ray exec tutorial.toml tutorial.sqlite 

Survived mutants:

1. ```
--- mutation diff ---
--- aLib/typing.py
+++ bLib/typing.py
@@ -1103,7 +1103,7 @@
 if Protocol in bases:
 return ()
 i = bases.index(self)
-for b in bases[i+1:]:
+for b in bases[i*1:]:
 if isinstance(b, _BaseGenericAlias) and b is not self:
 return ()
 return (self.__origin__,)
```

2. ```
--- mutation diff ---
--- aLib/typing.py
+++ bLib/typing.py
@@ -1103,7 +1103,7 @@
 if Protocol in bases:
 return ()
 i = bases.index(self)
-for b in bases[i+1:]:
+for b in bases[i//1:]:
 if isinstance(b, _BaseGenericAlias) and b is not self:
 return ()
 return (self.__origin__,)
```

3. ```
--- mutation diff ---
--- aLib/typing.py
+++ bLib/typing.py
@@ -1103,7 +1103,7 @@
 if Protocol in bases:
 return ()
 i = bases.index(self)
-for b in bases[i+1:]:
+for b in bases[i**1:]:
 if isinstance(b, _BaseGenericAlias) and b is not self:
 return ()
 return (self.__origin__,)
```

I've attached the full report to this issue if it is interesting to anyone: 
https://gist.github.com/sobolevn/79f1729dcf0b8c4b2a9bcee67027673a

--
components: Tests
messages: 405319
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Mutation tests results of typing.py
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



[issue45671] str(CancelledError()) is empty

2021-10-29 Thread lilydjwg


New submission from lilydjwg :

When I try to print an asyncio.CancelledError object, I do not see it and I 
thought something went wrong.

CancelledError inherits from BaseException and all BaseException subclasses 
(e.g. SystemExit, KeyboardInterrupted) seem to return empty strings for str(e). 
While I never tried to print SystemExit or KeyboardInterrupted, I did try to 
print an CancelledError. It doesn't have a lot information but all other 
exceptions I tried to print return something so I expect CancelledError to be 
the same.

I know repr(e). I was just lazy and I expect Python to not be confusing even 
I'm lazy.

--
components: asyncio
messages: 405318
nosy: asvetlov, lilydjwg, yselivanov
priority: normal
severity: normal
status: open
title: str(CancelledError()) is empty
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue45670] New .mapping attribute is broken for some existing uses of dict views

2021-10-29 Thread Joshua Bronson


New submission from Joshua Bronson :

As of bpo-40890 (released in Python 3.10), dict views now provide a public 
.mapping attribute, intended to allow users to recover a mappingproxy pointing 
to the original mapping.

However, this new attribute can actually point to the wrong mapping for some 
existing uses of dict views. And since the .mapping attribute is read-only, 
these existing uses have no way to set it to the correct value.

My bidict library (see https://github.com/jab/bidict) provides an example of 
this.

A bidict implements a bidirectional mapping by building on top of two dicts 
(i.e. regular old one-directional mappings) internally -- one for the forward 
direction, and one for the inverse. When you call e.g. keys() or values() on a 
bidict, you get back a dict_keys view from one of the backing dicts, because 
this is a much more optimized implementation of these views than 
collections.abc.KeysView would be:

>>> import bidict
>>> b = bidict.bidict(one=1, two=2)
>>> b
bidict({'one': 1, 'two': 2})
>>> b.keys()
dict_keys(['one', 'two'])
>>> b.values()
dict_keys([1, 2])


However, now that these built-in dict_keys objects provide a .mapping attribute 
in Python 3.10, it points to one of the internal, backing dicts in this case, 
which is an implementation detail, rather than to the bidict instance:

>>> b.keys().mapping  # wrong
mappingproxy({'one': 1, 'two': 2})
>>> b.values().mapping  # wrong
mappingproxy({1: 'one', 2: 'two'})


Instead of the above, you should get:

>>> b.keys().mapping  # corrected:
mappingproxy(bidict({'one': 1, 'two': 2}))
>>> b.values().mapping  # corrected:
mappingproxy(bidict({'one': 1, 'two': 2}))


Since the .mapping attribute is read-only, there's no way for bidict to both 
keep exposing the optimized dict_keys implementations, which up till now have 
been perfectly correct, while now exposing a correct .mapping attribute for 
users of Python 3.10+.

(Other bidict types demonstrate this problem more by exposing even more 
obviously-unintended implementation details via this new .mapping attribute:

>>> f = bidict.FrozenOrderedBidict(b)
>>> f
FrozenOrderedBidict([('one', 1), ('two', 2)])
>>> f.keys().mapping  # ouch
mappingproxy({'one': _Node(prv=..., self=..., nxt=...), 'two': _Node(prv=..., 
self=..., nxt=...)})

Those internal _Node objects were never meant to be exposed to consumers, 
they're an implementation detail.)


It looks like cases like this were not considered when discussing bpo-40890, 
and if they had been, I wonder if the implementation would have been accepted 
as-is.

Here are some potential directions for how to improve things for the future:

1. Expose a way for dict view users like bidict to continue to use optimized 
dict view implementations while opting out of the new .mapping attribute

2. Make the .mapping attribute no longer read-only, so libraries like bidict 
can set it correctly before exposing it to users

3. Merely update the documentation in 
https://docs.python.org/3/library/stdtypes.html#:~:text=dictview.mapping,in%20version%203.10.
 to mention that, because the .mapping attribute is read-only, it may not point 
to the original, intended mapping, but rather some internal mapping that the 
user was not intended to be exposed to.


Looking forward to hearing your thoughts, and thanks for your consideration.

--
components: Interpreter Core
messages: 405317
nosy: jab, rhettinger
priority: normal
severity: normal
status: open
title: New .mapping attribute is broken for some existing uses of dict views
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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:

It's possible this crept in during the fix for bpo-44753.

--

___
Python tracker 

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



[issue45669] An 'ascii_alphanumerics' variable is missing in the 'strings' lib

2021-10-29 Thread Paolo Melchiorre


Change by Paolo Melchiorre :


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

___
Python tracker 

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



[issue14527] How to link with a non-system libffi?

2021-10-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

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



[issue45598] setup.py grep_headers_for() is broken by design

2021-10-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

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



[issue45350] configure incorrectly ignores pkg-config information for libffi and Tcl/Tk in 3.10

2021-10-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

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



[issue45643] SIGSTKFLT is missing from the signals module on Linux

2021-10-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-10-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

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



[issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations

2021-10-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

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



[issue44828] tkinter.filedialog linked with Tk 8.6.11 crashes on macOS 12 Monterey, breaking IDLE saves

2021-10-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

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



[issue45484] test_pickle segfault on s390x RHEL7 LTO 3.x

2021-10-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

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



[issue45668] Some PGO tests are failing when building with --enable-optimizations --disable-test-modules

2021-10-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

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



[issue45669] An 'ascii_alphanumerics' variable is missing in the 'strings' lib

2021-10-29 Thread Paolo Melchiorre


New submission from Paolo Melchiorre :

It is very common to construct a variable containing alphanumeric values as a 
basis for generating random strings, especially in the web environment as a 
slug to be used in URLs:

>>> import string
>>> ascii_alphanumerics = string.ascii_letters + string.digits
>>> ascii_alphanumerics
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'


I suggest inserting a variable for just this purpose directly into Python's 
"string" module:

>>> import string
>>> string.ascii_alphanumerics
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'

--
components: Library (Lib)
messages: 405315
nosy: pauloxnet
priority: normal
severity: normal
status: open
title: An 'ascii_alphanumerics' variable is missing in the 'strings' lib
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



[issue45548] Update Modules/Setup

2021-10-29 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset f0150ac94a85c863ec1dcb58b9e33ed7ce465ec8 by Christian Heimes in 
branch 'main':
bpo-45548: Some test modules must be built as shared libs (GH-29268)
https://github.com/python/cpython/commit/f0150ac94a85c863ec1dcb58b9e33ed7ce465ec8


--

___
Python tracker 

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



[issue45535] Enum's dir() does not contain inherited members

2021-10-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 29316 looks complicated.

First of all, why do Enum needs a custom __dir__? What is wrong with the 
default implementation?

--

___
Python tracker 

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



[issue45535] Enum's dir() does not contain inherited members

2021-10-29 Thread Alex Waygood


Change by Alex Waygood :


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

___
Python tracker 

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:

N.B. I was able to reproduce this on recent 3.9 versions as well.

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 191a93905a84f272b2232701dc5dcc69987330f5 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-45628: Check all parts of the suffix for an extension match. 
(GH-29310) (GH-29314)
https://github.com/python/cpython/commit/191a93905a84f272b2232701dc5dcc69987330f5


--

___
Python tracker 

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 317e0c99e3804310f4bee23e497d9d84b717d7f7 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-45628: Check all parts of the suffix for an extension match. 
(GH-29310) (GH-29313)
https://github.com/python/cpython/commit/317e0c99e3804310f4bee23e497d9d84b717d7f7


--

___
Python tracker 

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



[issue45668] Some PGO tests are failing when building with --enable-optimizations --disable-test-modules

2021-10-29 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-29 Thread swgmma


swgmma  added the comment:

Thanks all for the guidance. Have gone back to the original `force_hide` with 
the suggested documentation.

--

___
Python tracker 

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



[issue45668] Some PGO tests are failing when building with --enable-optimizations --disable-test-modules

2021-10-29 Thread Christian Heimes


New submission from Christian Heimes :

Some PGO tests are failing when Python is build with options ./configure 
--disable-test-modules --enable-optimizations . Test failures are caused by 
missing _testcapi module.

./python -m test --pgo --timeout=1200 || true
test test_array failed
test test_bytes failed
test test_cmath failed
test test_codecs failed
0:00:23 load avg: 1.98 [13/44] test_datetime
Failed to call load_tests:
...
ModuleNotFoundError: No module named '_testcapi'
test test_embed failed
test test_float failed
test test_itertools failed
test test_ordered_dict failed
test test_pickle failed
test test_struct failed
test test_unicode failed
test test_xml_etree_c failed
test_xml_etree_c failed (3 errors)

--
components: Build, Tests
messages: 405308
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Some PGO tests are failing when building with --enable-optimizations 
--disable-test-modules
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



[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-29 Thread Eryk Sun


Eryk Sun  added the comment:

> There's nothing gained by complicating this API with more options.

Yes, both options is too much. I suggested force_hide_console as an alternative 
to force_hide, not for both to be implemented. It would be the same as 
CreateNoWindow in .NET ProcessStartInfo [1], but ProcessStartInfo also has 
WindowStyle, and one or the other is ignored depending on the value of 
UseShellExecute. I see a lot of confusion online regarding these .NET 
ProcessStartInfo properties, which is something I'd like to avoid.

A benefit of force_hide based on wShowWindow=SW_HIDE is feature parity with 
ShellExecuteExW(), if subprocess ever supports the shell API. ShellExecuteExW() 
does not support CREATE_NO_WINDOW, but it supports a show-window command and 
CREATE_NEW_CONSOLE (i.e. the inverse of SEE_MASK_NO_CONSOLE).

---
[1] 
https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo?view=net-5.0

--

___
Python tracker 

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



[issue45655] List of PEPs at top of typing docs is too long to be readable

2021-10-29 Thread miss-islington


miss-islington  added the comment:


New changeset 6742b0dfb61ebdb92a1ff633ec071734b5d39981 by Miss Islington (bot) 
in branch '3.10':
bpo-45655: Add ref to union type expressions at top of typing docs (GH-29309)
https://github.com/python/cpython/commit/6742b0dfb61ebdb92a1ff633ec071734b5d39981


--

___
Python tracker 

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



[issue42280] The list of standard generic collections is incomplete

2021-10-29 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood
nosy_count: 5.0 -> 6.0
pull_requests: +27583
pull_request: https://github.com/python/cpython/pull/29308

___
Python tracker 

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27582
pull_request: https://github.com/python/cpython/pull/29314

___
Python tracker 

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45655] List of PEPs at top of typing docs is too long to be readable

2021-10-29 Thread Ken Jin


Ken Jin  added the comment:


New changeset d9575218d7ab3d85b15ce3d4779660b9b724d343 by Alex Waygood in 
branch 'main':
bpo-45655: Add ref to union type expressions at top of typing docs (GH-29309)
https://github.com/python/cpython/commit/d9575218d7ab3d85b15ce3d4779660b9b724d343


--

___
Python tracker 

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



[issue45655] List of PEPs at top of typing docs is too long to be readable

2021-10-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27580
pull_request: https://github.com/python/cpython/pull/29312

___
Python tracker 

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



[issue45655] List of PEPs at top of typing docs is too long to be readable

2021-10-29 Thread Alex Waygood


Change by Alex Waygood :


--
pull_requests: +27579
pull_request: https://github.com/python/cpython/pull/29309

___
Python tracker 

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



[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-29 Thread Ken Jin


Change by Ken Jin :


--
pull_requests:  -27577

___
Python tracker 

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



[issue44899] tarfile: add support for creating an archive of potentially changing files

2021-10-29 Thread Marko Tuononen


Change by Marko Tuononen :


Removed file: https://bugs.python.org/file50411/tarfile_ut.py

___
Python tracker 

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



[issue44899] tarfile: add support for creating an archive of potentially changing files

2021-10-29 Thread Marko Tuononen


Change by Marko Tuononen :


Added file: https://bugs.python.org/file50412/tarfile_ut.py

___
Python tracker 

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 8a77f59de51f1fd6062f0fefe73ee3059d714144 by Vinay Sajip in branch 
'main':
bpo-45628: Check all parts of the suffix for an extension match. (GH-29310)
https://github.com/python/cpython/commit/8a77f59de51f1fd6062f0fefe73ee3059d714144


--

___
Python tracker 

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



[issue44899] tarfile: add support for creating an archive of potentially changing files

2021-10-29 Thread Marko Tuononen


Marko Tuononen  added the comment:

Please find attached an example how to reproduce the problem in question.

$ python3 -m unittest tarfile_ut.py
E
==
ERROR: test_stat (tarfile_ut.TestClass)
--
Traceback (most recent call last):
  File "/usr/lib64/python3.6/unittest/mock.py", line 1183, in patched
return func(*args, **keywargs)
  File "/var/work/mtuonone/tarfile_ut.py", line 39, in test_stat
tar.add(TEMP_FILENAME)
  File "/usr/lib64/python3.6/tarfile.py", line 1952, in add
self.addfile(tarinfo, f)
  File "/usr/lib64/python3.6/tarfile.py", line 1980, in addfile
copyfileobj(fileobj, self.fileobj, tarinfo.size, bufsize=bufsize)
  File "/usr/lib64/python3.6/tarfile.py", line 257, in copyfileobj
raise exception("unexpected end of data")
OSError: unexpected end of data

--
Ran 1 test in 0.006s

FAILED (errors=1)
$

--
Added file: https://bugs.python.org/file50411/tarfile_ut.py

___
Python tracker 

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Change by Vinay Sajip :


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

___
Python tracker 

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



[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-29 Thread Steve Dower


Steve Dower  added the comment:

There's nothing gained by complicating this API with more options.

Document it as "Passing *force_hide* as True attempts to start the application 
without creating or showing any windows. Some applications may ignore this 
request, and applications that are hidden often cannot be used or exited by 
users."

We don't have to specify all the nuances here, especially since we may come up 
with a more reliable way to do this in the future. Specifying too much detail 
in the documentation will prevent us from improving it without breaking stuff.

--

___
Python tracker 

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



[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-29 Thread Chris Wesseling


Change by Chris Wesseling :


--
pull_requests: +27577
pull_request: https://github.com/python/cpython/pull/29273

___
Python tracker 

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



[issue45655] List of PEPs at top of typing docs is too long to be readable

2021-10-29 Thread Alex Waygood

Alex Waygood  added the comment:

Thanks, Łukasz and Ken, for reviewing and merging!

--

___
Python tracker 

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



[issue45665] Problems caused by isinstance(list[int], type) returning True

2021-10-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
title: Problems caused by isinstance(list[int]) returning True -> Problems 
caused by isinstance(list[int], type) returning True

___
Python tracker 

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



[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a043706f907e82ee6a562005991ff0b896a4e64d by Serhiy Storchaka in 
branch '3.9':
[3.9] [3.10] bpo-45502: Fix test_shelve (GH-29003) (GH-29305) (GH-29306)
https://github.com/python/cpython/commit/a043706f907e82ee6a562005991ff0b896a4e64d


--

___
Python tracker 

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



[issue45655] List of PEPs at top of typing docs is too long to be readable

2021-10-29 Thread Ken Jin


Ken Jin  added the comment:

Argh, I merged GH-29302, but messed up the commit title since I'm on mobile. 
Sorry.

Currently it says:
[3.10] bo-45655: Add "relevant PEPs" section to typing documentation (GH-29302)

It should be:

[3.10] bpo-45655: Add "relevant PEPs" section to typing documentation 
(GH-29280) (GH-29302)

I don't think it's big enough of a deal to revert and re-commit. So we're done 
here. Thanks for your improvements Alex.

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



[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-10-29 Thread swgmma


swgmma  added the comment:

What if we change `force_hide` from True/False to something like "off" | 
"console" | "all" (defaulting to "off")?

--

___
Python tracker 

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



[issue45667] Better error message on failing to create a venv due to failing ensurepip

2021-10-29 Thread Julien Palard

New submission from Julien Palard :

Currently if ensurepip fails for a reason or another, for example if a wrong 
module gets imported:

$ touch http.py
$ python3.10 -m venv .venv
Error: Command '['/tmp/.venv/bin/python3.10', '-Im', 'ensurepip', '--upgrade', 
'--default-pip']' returned non-zero exit status 1.

the error is not helpfull. Maybe venv should just dump the stderr from 
ensurepip so we can learn a bit more about it (it's « understandable » in 
ensurepip traceback that it's in relation with http.py, in the given example.)

--
messages: 405297
nosy: mdk
priority: normal
severity: normal
status: open
title: Better error message on failing to create a venv due to failing ensurepip

___
Python tracker 

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



[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-10-29 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-10-29 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
components: +Build -Library (Lib)

___
Python tracker 

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



  1   2   >