[issue45855] PyCapsule_Import still using PyImport_ImportModuleNoBlock

2021-12-11 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303
nosy_count: 2.0 -> 3.0
pull_requests: +28271
pull_request: https://github.com/python/cpython/pull/30046

___
Python tracker 

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



[issue46045] NetBSD: do not use POSIX semaphores

2021-12-11 Thread Thomas Klausner


New submission from Thomas Klausner :

On NetBSD by default, the following tests do not finish in > 1h:

1:07:13 load avg: 0.00 running: test_compileall (1 hour 7 min), 
test_multiprocessing_fork (1 hour 7 min), test_concurrent_futures (1 hour 6 min)

Defining HAVE_BROKEN_POSIX_SEMAPHORES fixes this, and they finish:

0:00:32 load avg: 10.63 [408/427/17] test_compileall passed ...
...
0:02:37 load avg: 3.04 [427/427/22] test_concurrent_futures passed (2 min 33 
sec)

The last one fails:
test_multiprocessing_fork

with most of the subtests failing like this:

ERROR: test_shared_memory_SharedMemoryServer_ignores_sigint 
(test.test_multiprocessing_fork.WithProcessesTestSharedMemory)
--
Traceback (most recent call last):
  File 
"/scratch/lang/python310/work/Python-3.10.1/Lib/test/_test_multiprocessing.py", 
line 4006, in test_shared_memory_SharedMemoryServer_ignores_sigint
sl = smm.ShareableList(range(10))
  File 
"/scratch/lang/python310/work/Python-3.10.1/Lib/multiprocessing/managers.py", 
line 1372, in ShareableList
sl = shared_memory.ShareableList(sequence)
  File 
"/scratch/lang/python310/work/Python-3.10.1/Lib/multiprocessing/shared_memory.py",
 line 327, in __init__
self.shm = SharedMemory(name, create=True, size=requested_size)
  File 
"/scratch/lang/python310/work/Python-3.10.1/Lib/multiprocessing/shared_memory.py",
 line 92, in __init__
self._fd = _posixshmem.shm_open(
OSError: [Errno 86] Not supported: '/psm_b1ec903a'

I think this is a separate issue, so I'd like to define 
HAVE_BROKEN_POSIX_SEMAPHORES for now.

This has been done in pkgsrc since at least python 2.7 (in 2011), I haven't dug 
deeper.

--
components: Interpreter Core
messages: 408291
nosy: wiz
priority: normal
severity: normal
status: open
title: NetBSD: do not use POSIX semaphores
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



[issue46045] NetBSD: do not use POSIX semaphores

2021-12-11 Thread Thomas Klausner


Change by Thomas Klausner :


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

___
Python tracker 

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



[issue46046] I/O bound threads got to no chance to run with small CPU bound threads with new GIL

2021-12-11 Thread Souvik Ghosh


New submission from Souvik Ghosh :

According to David Beazley' talk in PyCon'2010 in Atlanta Georgia, he 
demonstrated about a new GIL with running CPU bound and I/O bound threads 
together.

He said the talk that the threads which are forced to timeout of 5ms, will have 
the lower priority(which is CPU bound) and the thread which suspends the GIL 
within 5ms will have higher priority (which is I/O bound). 

What happens in the following code is if I set args=(1000,) (seven zero 
after 1) then only I/O bound runs and returns when CPU bound takes much time to 
execute. But if I decrease that args to args=(1000,) then I/O bound got no 
chance to reaquire the GIL in the meantime even though the 
sys.getswitchinterval() is equal to 5ms(By default). If I/O bound doesn't 
reacquire GIL with args=(1,) then the time to execute to run 
only the CPU bound takes 0.426035414 seconds. Thats means almost ticks 
0.426035414/0.005=85 (approx) times to set the priority in between the 
two threads. In that case if the I/O got more priority within that time, it 
should have returned the value within that ticks. But I didn't happen. 

import threading
from queue import Queue
from timeit import default_timer as timer
import urllib.request


q = Queue()  # Queue technique to pass returns among threads while running


def decrement(numbers):  # CPU bound
while numbers > 0:
numbers -= 1
if not q.empty():
"""I added this method because this thread will run most of the time
because it's mostly cpu bound"""
print(numbers)
print(q.get(block=False))
print(timer() - start)  # It tell after when exactly I/O bound 
returns value after both the threads started to run


def get_data():  # I/O bound

with urllib.request.urlopen("https://www.google.com";) as dt:
q.put(dt.read(), block=False)


if __name__ == "__main__":
start = timer()
t1 = threading.Thread(target=get_data)
#t2 = threading.Thread(target=decrement, args=(1000,)) #For this I/O 
responds and returns
t2 = threading.Thread(target=decrement, args=(10,)) # I/O doesn't 
responds at all
t1.start()
t2.start()

t1.join()
t2.join()
print(timer() - start)

Look at the second code...


import threading
from queue import Queue
from timeit import default_timer as timer
import urllib.request
import sys


q = Queue()  # Queue technique to pass returns among threads while running


def decrement(numbers):  # CPU bound
while numbers > 0:
numbers -= 1
if not q.empty():
"""I added this method because this thread will run most of the time
because it's mostly cpu bound"""
print(numbers)
print(q.get(block=False))
print(timer() - start)  # It tell after when exactly I/O bound 
returns value after both the threads started to run


def get_data():  # I/O bound

with urllib.request.urlopen("https://www.google.com";) as dt:
q.put(dt.read(), block=False)


if __name__ == "__main__":
sys.setswitchinterval(0.0001)
start = timer()
t1 = threading.Thread(target=get_data)
#t2 = threading.Thread(target=decrement, args=(100,)) #I/O responds 
with this 
t2 = threading.Thread(target=decrement, args=(1,))# I/O doesn't 
responds at all even with this 0.0001 seconds of 
threads switching interval
t1.start()
t2.start()

t1.join()
t2.join()
print(timer() - start)

Can't we have a more better version of GIL to set I/O threads(overall) 
priorities even more better and not to degrade the CPU bound and better 
callbacks in response? Or, try to remove the GIL?

Thank you so much, great future of Python!

--
components: Interpreter Core
files: GIL9.py
messages: 408292
nosy: souvikghosh
priority: normal
severity: normal
status: open
title: I/O bound threads got to no chance to run with small CPU bound threads 
with new GIL
type: performance
versions: Python 3.10
Added file: https://bugs.python.org/file50487/GIL9.py

___
Python tracker 

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



[issue45929] extend json.tool --json-lines to ignore empty rows

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The current implementation allows for the final character of the input to be a 
newline. It does not allow double newlines. In the original example 

   echo -e '{"foo":1}\n{"bar":2}\n'

the echo command adds a newline to the output (which already contains the 
trailing newline), so the result ends with two newlines. Use option -n to 
disable adding newline in echo.

I afraid that if we add support of empty lines, soon we will get requests for 
supporting comments, encoding cookies, single-quote strings, non-quoted keys, 
hexadecimal integers and other possible JSON extensions.

--

___
Python tracker 

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



[issue21964] inconsistency in list-generator comprehension with yield(-from)

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Resolved in issue10544.

--
nosy: +serhiy.storchaka
resolution: out of date -> duplicate
stage: test needed -> resolved
status: pending -> closed
superseder:  -> yield expression inside generator expression does nothing

___
Python tracker 

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



[issue46047] When using Py_NewInterpreter, some modules fail to import in Python 3.10

2021-12-11 Thread Jonas Witschel


New submission from Jonas Witschel :

Consider the following minimal example C code which is trying to import 
jsonschema (https://python-jsonschema.readthedocs.io/en/stable/), compiled 
using "gcc test_newinterpreter.c -I /usr/include/python3.10 -lpython3.10 -o 
test_newinterpreter" or similar:

#include 

int main(void) {
Py_Initialize();
PyThreadState *interpreter = Py_NewInterpreter();
PyRun_SimpleString("import jsonschema");
Py_Finalize();  
}

In Python 3.9.9, this works as expected. However in Python 3.10.0, the 
following error is produced:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.10/site-packages/jsonschema/__init__.py", line 21, in 

from jsonschema._types import TypeChecker
  File "/usr/lib/python3.10/site-packages/jsonschema/_types.py", line 168, in 

draft3_type_checker = TypeChecker(
TypeError: TypeChecker() takes no arguments

Removing the Py_NewInterpreter() call makes the example work as expected in 
Python 3.10.0.

This might be related to the enhancements to the type cache from bpo-42745.

Another recent bug report I found that might possibly be related is bpo-46036.

This bug breaks some WeeChat plugins that try to import one of the affected 
modules, e.g. weechat-matrix (https://github.com/poljar/weechat-matrix).

--
components: C API, Subinterpreters
messages: 408295
nosy: diabonas
priority: normal
severity: normal
status: open
title: When using Py_NewInterpreter, some modules fail to import in Python 3.10
type: compile error
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



[issue46043] Python Launcher Not Opening Files.

2021-12-11 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Are you on macOS 10.15 or later?  If so, this is a duplicate of issue40477.

A workaround mentioned in that issue is to make sure that Terminal.app is open.

--
type: crash -> behavior

___
Python tracker 

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



[issue46047] When using Py_NewInterpreter, some modules fail to import in Python 3.10

2021-12-11 Thread Jonas Witschel


Jonas Witschel  added the comment:

Downstream bug report in Arch Linux: https://bugs.archlinux.org/task/72979

--

___
Python tracker 

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



[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-11 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

let's see whether I promised too much, I don't know CPython's symtable.c too 
well yet ;-). Will shout for help when I get stuck.

Anyway, here is a related bug, coming from the same symtable function 
symtable_add_def_helper, also with an imprecise error location:

$ cat x.py 
{i for i in range(5)
if (j := 0)
for j in range(5)}

$ ./python x.py 
  File "/home/cfbolz/projects/cpython/x.py", line 1
{i for i in range(5)

SyntaxError: comprehension inner loop cannot rebind assignment expression 
target 'j'

--

___
Python tracker 

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



[issue46047] When using Py_NewInterpreter, some modules fail to import in Python 3.10

2021-12-11 Thread Jonas Witschel


Jonas Witschel  added the comment:

I notice this has already been reported as bpo-46006 and bpo-46034, so closing 
in favour of these.

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2021-12-11 Thread Jonas Witschel


Change by Jonas Witschel :


--
nosy: +diabonas

___
Python tracker 

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



[issue46048] embeddable distro cannot import modules

2021-12-11 Thread Steve Dower


New submission from Steve Dower :

The embeddable distro cannot import native modules.

This is because the '.' entry in the ._pth file is incorrect parsed by the new 
getpath module (issue45582).

--
assignee: steve.dower
components: Interpreter Core
messages: 408300
nosy: lukasz.langa, steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: embeddable distro cannot import 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



[issue46048] embeddable distro cannot import modules

2021-12-11 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue45995] string formatting: normalize negative zero

2021-12-11 Thread John Belmonte


Change by John Belmonte :


--
keywords: +patch
nosy: +jbelmonte
nosy_count: 5.0 -> 6.0
pull_requests: +28274
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30049

___
Python tracker 

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



[issue25834] getpass falls back when sys.stdin is changed

2021-12-11 Thread Adam Bartoš

Adam Bartoš  added the comment:

Sorry, I don't. But my use case is not relevant any more since my package was a 
workround for problems with entering Unicode interactively on Windows, and 
these problems were resolved in Python since then.

--

___
Python tracker 

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



[issue46046] I/O bound threads got to no chance to run with small CPU bound threads with new GIL

2021-12-11 Thread Souvik Ghosh


Souvik Ghosh  added the comment:

Python-ideas link in here:-
https://mail.python.org/archives/list/python-id...@python.org/message/A5MX6SQUHP65JC6V5ZFCCHMMJURM4KHB/

--

___
Python tracker 

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



[issue46048] embeddable distro cannot import modules

2021-12-11 Thread Steve Dower


Steve Dower  added the comment:


New changeset 971ece8e1738b1107dda692cc44c6d8ddce384cd by Steve Dower in branch 
'main':
bpo-46048: Fix parsing of single character lines in getpath readlines() 
(GH-30048)
https://github.com/python/cpython/commit/971ece8e1738b1107dda692cc44c6d8ddce384cd


--

___
Python tracker 

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



[issue46048] embeddable distro cannot import modules

2021-12-11 Thread Steve Dower


Change by Steve Dower :


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



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue46049] ._pth files untested on Linux

2021-12-11 Thread Steve Dower


New submission from Steve Dower :

Currently ._pth files are "enabled" for all platforms, but are only tested on 
Windows.

Extend the tests in test_site to work on all platforms.

--
assignee: steve.dower
components: Interpreter Core
messages: 408304
nosy: steve.dower
priority: normal
severity: normal
stage: patch review
status: open
title: ._pth files untested on Linux
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



[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2021-12-11 Thread Christian Heimes


Christian Heimes  added the comment:

Adding regular expression support to -W and PYTHONWARNINGS env var turns the 
options into potential attack vectors. It can introduce REDOS vulnerability.

--
keywords: +security_issue
nosy: +christian.heimes
type:  -> enhancement
versions: +Python 3.11 -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



[issue46049] ._pth files untested on Linux

2021-12-11 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +28276
pull_request: https://github.com/python/cpython/pull/30051

___
Python tracker 

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



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, it is related to issue45665. It is a complicated case due to coincidence 
of several circumstances.

1. isinstance(list[int], type) is True, while isinstance(typing.List[int], 
type) is False. list[int] is considered a type in this check.

2. list[int].__mro__ == list.__mro__, while typing.List[int] does not have the 
__mro__ attribute.  list[int] is considered a type in this check.

3. issubclass(cls, list[int]) raises a TypeError (the same for 
typing.List[int]). list[int] cannot be used as a type here.

4. 2-argument registry() does not check the type of its first argument. 
f.registry(42, ...) is silently passed.

In 2-argument registry() typing.List[int] is passed due to (4) and ignored in 
dispatch() due to (2). list[int] is passed due to (4), but caused error due to 
(3).

In other uses of registry() (1-argument decorator factory and decorator with 
annotations) typing.List[int] is not passed due to 1. list[int] is passed due 
to (1) and caused error due to (3).

The proposed PR makes list[int] be treated the same way as typing.List[int]. It 
also makes 2-argument registry() rejecting invalid first argument, so all three 
forms of registry() accept and reject now the same types.

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



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

2021-12-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +functools' singledispatch does not support GenericAlias

___
Python tracker 

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



[issue34798] pprint ignores the compact parameter for dicts

2021-12-11 Thread Matt Bogosian


Matt Bogosian  added the comment:

Please consider highlighting that dicts are not included in the documentation. 
While *technically* true, this ...

> compact impacts the way that long sequences (lists, tuples, sets, etc) are 
> formatted. If compact is false (the default) then each item of a sequence 
> will be formatted on a separate line. If compact is true, as many items as 
> will fit within the width will be formatted on each output line.

... has several problems.

First, sequence is a term of art that also has a common meaning. This creates a 
potential ambiguity in the understanding of the reader. Resolving that 
ambiguity in this context requires that readers have already internalized that 
dicts are not Python sequences. Those new to Python may not understand the (to 
them, subtle) differences between Python's iterables and sequences. Second, the 
"etc" only expands that ambiguity and invites confusion. Third, the term 
"items" is strongly associated with dicts and is used several times throughout 
the paragraph.

This ...

> According to https://docs.python.org/3/library/pprint.html compact impacts 
> the way that sequences are displayed, and a dict is not a sequence.

... is unhelpfully pedantic, and ignorant of the needs of the newcomer (a key 
demographic of documentation). Documentation is a core product surface with a 
diverse audience. Rather than focus on technical correctness, documentation 
authors should focus on accessibility. Redundancy is a feature, not a bug. You 
can't predict how your reader got to that slice of the documentation. Imagine 
this as an opportunity to educate or reinforce concepts for readers, not as an 
opportunity to argue from a position of technical superiority.

The fact that there are now four developers who have taken their time to file 
patches, bugs, and comments is pretty strong signal that confusion exists among 
the audience and that the documentation is insufficient.

--
nosy: +posita

___
Python tracker 

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



[issue25834] getpass falls back when sys.stdin is changed

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

Thanks, I'll close this and we can revisit if a new use case turns up.

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2021-12-11 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 3.0 -> 4.0
pull_requests: +28277
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30052

___
Python tracker 

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



[issue46049] ._pth files untested on Linux

2021-12-11 Thread Steve Dower


Steve Dower  added the comment:


New changeset bfc59ed0a00106f5ba4a32a0c5b3dbe71d12665d by Steve Dower in branch 
'main':
bpo-46049: Fixes ._pth support on non-Windows (GH-30051)
https://github.com/python/cpython/commit/bfc59ed0a00106f5ba4a32a0c5b3dbe71d12665d


--

___
Python tracker 

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



[issue18861] Problems with recursive automatic exception chaining

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

I think this problem is actually simpler than what we've been discussing. 

First, note that by-and-large our current system works:

>>> try:
...   raise VE(1)
... except VE as e1:
...   try:
... raise VE(2)
...   except VE as e2:
... raise VE(3) from e2
... 
Traceback (most recent call last):
  File "", line 2, in 
ValueError: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 5, in 
ValueError: 2

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

Traceback (most recent call last):
  File "", line 7, in 
ValueError: 3



Here VE(2) is the cause of VE(3) and VE(1) is the context of VE(2), so VE(1) is 
not hidden by the fact that VE(3) has a cause.

The reason that Nick's example didn't work is because he is doing

raise VE(3) from VE(2)

i.e., creating a new exception VE(2) that doesn't have VE(1) as a context. I'm 
not sure there is a use case for this, so I don't think we need to worry about 
it.


The case of None does need fixing. We use None to indicate that there was no 
cause (while suppressing context). But None can't have a context, so VE(1) gets 
lost. We could, instead of None, use a NoException(Exception) class. This 
exception would be chained with the current exc_info() as context so that it 
works like VE(1) as above, and the traceback printing logic will know that it 
needs to be omitted from the output.


This proposal involves no changes to the exception propagation mechanism of the 
interpreter. It would require these changes:

1. Define the new exception type
2. in do_raise, in the case of raise-from the None case changes
3. traceback display code needs to be updated to omit NoExceptions

--
versions: +Python 3.11 -Python 3.5

___
Python tracker 

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



[issue46049] ._pth files untested on Linux

2021-12-11 Thread Steve Dower


Change by Steve Dower :


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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-11 Thread Ned Batchelder


Ned Batchelder  added the comment:

Tox isn't needed, just venv from the stdlib:


$ python3.11.0a2 -m venv venv_a2

$ venv_a2/bin/python -c "import sys,os.path; print(e := sys._base_executable); 
print(os.path.exists(e))"
/private/tmp/venv_a2/bin/python
True

$ python3.11.0a3 -m venv venv_a3

$ venv_a3/bin/python -c "import sys,os.path; print(e := sys._base_executable); 
print(os.path.exists(e))"
/usr/local/bin/python
False

--

___
Python tracker 

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-11 Thread Steve Dower


Steve Dower  added the comment:

What's the contents of the pyvenv.cfg in these cases?

It looks like the first case is definitely wrong, because the base 
executable should not be in "venv_a2" (that's sys.executable), but I 
don't know where it should be on your system.

--

___
Python tracker 

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



[issue23469] Delete Misc/*.wpr files

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy -patch

___
Python tracker 

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2021-12-11 Thread Yevhenii Hyzyla


Change by Yevhenii Hyzyla :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-11 Thread Ned Batchelder


Ned Batchelder  added the comment:

The two venvs seem analogous:


$ cat venv_a2/pyvenv.cfg
home = /usr/local/bin
include-system-site-packages = false
version = 3.11.0

$ ls -al venv_a2/bin
total 72
drwxr-xr-x  13 nedbatchelder  wheel   416 Dec 11 10:43 ./
drwxr-xr-x   6 nedbatchelder  wheel   192 Dec 11 10:43 ../
-rw-r--r--   1 nedbatchelder  wheel  9033 Dec 11 10:43 Activate.ps1
-rw-r--r--   1 nedbatchelder  wheel  1993 Dec 11 10:43 activate
-rw-r--r--   1 nedbatchelder  wheel   919 Dec 11 10:43 activate.csh
-rw-r--r--   1 nedbatchelder  wheel  2061 Dec 11 10:43 activate.fish
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip*
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip3*
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip3.11*
lrwxr-xr-x   1 nedbatchelder  wheel14 Dec 11 10:43 python@ -> python3.11.0a2
lrwxr-xr-x   1 nedbatchelder  wheel14 Dec 11 10:43 python3@ -> 
python3.11.0a2
lrwxr-xr-x   1 nedbatchelder  wheel14 Dec 11 10:43 python3.11@ -> 
python3.11.0a2
lrwxr-xr-x   1 nedbatchelder  wheel29 Dec 11 10:43 python3.11.0a2@ -> 
/usr/local/bin/python3.11.0a2

$ cat venv_a3/pyvenv.cfg
home = /usr/local/bin
include-system-site-packages = false
version = 3.11.0

$ ls -al venv_a3/bin
total 72
drwxr-xr-x  13 nedbatchelder  wheel   416 Dec 11 10:43 ./
drwxr-xr-x   6 nedbatchelder  wheel   192 Dec 11 10:43 ../
-rw-r--r--   1 nedbatchelder  wheel  9033 Dec 11 10:43 Activate.ps1
-rw-r--r--   1 nedbatchelder  wheel  1993 Dec 11 10:43 activate
-rw-r--r--   1 nedbatchelder  wheel   919 Dec 11 10:43 activate.csh
-rw-r--r--   1 nedbatchelder  wheel  2061 Dec 11 10:43 activate.fish
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip*
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip3*
-rwxr-xr-x   1 nedbatchelder  wheel   244 Dec 11 10:43 pip3.11*
lrwxr-xr-x   1 nedbatchelder  wheel14 Dec 11 10:43 python@ -> python3.11.0a3
lrwxr-xr-x   1 nedbatchelder  wheel14 Dec 11 10:43 python3@ -> 
python3.11.0a3
lrwxr-xr-x   1 nedbatchelder  wheel14 Dec 11 10:43 python3.11@ -> 
python3.11.0a3
lrwxr-xr-x   1 nedbatchelder  wheel29 Dec 11 10:43 python3.11.0a3@ -> 
/usr/local/bin/python3.11.0a3

--

___
Python tracker 

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



[issue45578] Missing tests for the dis module

2021-12-11 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
pull_requests: +28278
pull_request: https://github.com/python/cpython/pull/30058

___
Python tracker 

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



[issue46050] [pathlib] Option so that OSError does not block glob in pathlib library

2021-12-11 Thread matt


New submission from matt :

Hi there,
ISSUE DESCRIPTION
when I browse starting from the linux root ('/')
path = pathlib.Path('/')
_glob = '**/*'
for p in path.glob(_glob):

The program stops on my machine because of OSError.
  File "/usr/lib/python3.8/pathlib.py", line 535, in _select_from
entries = list(scandir_it)

OSError: [Errno 22] Invalid argument: '/proc/5916/task/5916/net'


Entering post mortem debugging...

> /usr/lib/python3.8/pathlib.py(535)_select_from()
533 try:
534 with scandir(parent_path) as scandir_it:
--> 535 entries = list(scandir_it)
536 for entry in entries:
537 if self.dironly:

I also another case is if a cloud drive is disconnected.

QUICK SOLUTION
I solved both issues for me by adding an adding an except OSError: return at 
the end of the two function below:

class _WildcardSelector(_Selector):
def _select_from(self, parent_path, is_dir, exists, scandir):
(...)
except OSError:
return

class _RecursiveWildcardSelector(_Selector):
def _iterate_directories(self, parent_path, is_dir, scandir):
(...)
except OSError:
return

FEATURE REQUEST
I don't know the consequences of those 2 modifications so perhaps they could 
follow an option when calling glob with an optional parameter ignoreOSerror = 
false by default?!

--
components: Library (Lib)
messages: 408314
nosy: matt32106
priority: normal
severity: normal
status: open
title: [pathlib] Option so that OSError does not block glob in pathlib library
type: enhancement
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



[issue46040] asyncio.coroutine documented as removed in 3.10

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
components: +asyncio
nosy: +asvetlov, yselivanov

___
Python tracker 

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



[issue45949] Provide pure-Python implementation of Programs/_freeze_module for cross building

2021-12-11 Thread Christian Heimes


Christian Heimes  added the comment:

In his code review Eric made a point that the relationship of variables and 
their impact on normal and cross builds are not obvious. I'm going to introduce 
new variables for freezing and freezing dependencies. Bonus: Cross builds no 
longer build non-functional _bootstrap_python and Programs/_freeze_module.

Normal build:

PYTHON_FOR_FREEZE=./_bootstrap_python
FREEZE_MODULE_BOOTSTRAP=./Programs/_freeze_module
FREEZE_MODULE_BOOTSTRAP_DEPS=Programs/_freeze_module
FREEZE_MODULE=$(PYTHON_FOR_FREEZE) $(srcdir)/Programs/_freeze_module.py
FREEZE_MODULE_DEPS=_bootstrap_python $(srcdir)/Programs/_freeze_module.py


Cross build:

PYTHON_FOR_FREEZE=/path/to/build/python
FREEZE_MODULE_BOOTSTRAP=$(PYTHON_FOR_FREEZE) 
$(srcdir)/Programs/_freeze_module.py
FREEZE_MODULE_BOOTSTRAP_DEPS=$(srcdir)/Programs/_freeze_module.py
FREEZE_MODULE=$(FREEZE_MODULE_BOOTSTRAP)
FREEZE_MODULE_DEPS=$(FREEZE_MODULE_BOOTSTRAP_DEPS)

--

___
Python tracker 

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



[issue40059] Provide a toml module in the standard library

2021-12-11 Thread Martin Reboredo


Martin Reboredo  added the comment:

A new python-ideas mail thread was created for this, you can check it out at 
https://mail.python.org/archives/list/python-id...@python.org/thread/IWJ3I32A4TY6CIVQ6ONPEBPWP4TOV2V7/.

--
nosy: +YakoYakoYokuYoku

___
Python tracker 

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



[issue34798] pprint ignores the compact parameter for dicts

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

Don't discuss on a closed issue. Create a new one if there is still a problem.

--

___
Python tracker 

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



[issue46040] asyncio.coroutine documented as removed in 3.10

2021-12-11 Thread Ken Jin


Change by Ken Jin :


--
keywords: +easy

___
Python tracker 

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-11 Thread Saaket Prakash


Saaket Prakash  added the comment:

I tried the same stuff as nedbat on WSL2, and I see similar change in the path 
of sys._base_executable (though I get a different "base" path on a3, so the 
path exists even there).

$ ~/.pyenv/versions/3.11.0a2/bin/python -m venv venv_a2
$ ~/.pyenv/versions/3.11.0a3/bin/python -m venv venv_a3
$ venv_a2/bin/python -c "import sys,os.path; print(e := sys._base_executable); 
print(os.path.exists(e))"
/home/ss/venv_a2/bin/python
True

$ venv_a3/bin/python -c "import sys,os.path; print(e := sys._base_executable); 
print(os.path.exists(e))"
/home/ss/.pyenv/versions/3.11.0a3/bin/python
True

$ cat venv_a2/pyvenv.cfg
home = /home/ss/.pyenv/versions/3.11.0a2/bin
include-system-site-packages = false
version = 3.11.0

$ cat venv_a3/pyvenv.cfg
home = /home/ss/.pyenv/versions/3.11.0a3/bin
include-system-site-packages = false
version = 3.11.0

--
nosy: +saaketp

___
Python tracker 

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-11 Thread Saaket Prakash


Saaket Prakash  added the comment:

But on windows with the python.org installer, the behavior is same for both 
both a2 and a3.

# With a3 installed

> py -m venv venv_a3
> venv_a3/Scripts/python -c "import sys,os.path; print(e := 
> sys._base_executable); print(os.path.exists(e))"
C:\Users\ss\AppData\Local\Programs\Python\Python311\python.exe
True
> cat venv_a3/pyvenv.cfg
home = C:\Users\ss\AppData\Local\Programs\Python\Python311
include-system-site-packages = false
version = 3.11.0

# With a2 installed

> py -m venv venv_a2
> venv_a2/Scripts/python -c "import sys,os.path; print(e := 
> sys._base_executable); print(os.path.exists(e))"
C:\Users\ss\AppData\Local\Programs\Python\Python311\python.exe
True
> cat venv_a2/pyvenv.cfg
home = C:\Users\ss\AppData\Local\Programs\Python\Python311
include-system-site-packages = false
version = 3.11.0

--

___
Python tracker 

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



[issue40059] Provide a toml module in the standard library

2021-12-11 Thread Christian Heimes


Christian Heimes  added the comment:

I just noticed that tomli has dropped support for Python 3.6. That's a road 
block for general adoption of the package in the Python ecosystem. Python 3.6 
is the default Python interpreter in CentOS 8, C8S, RHEL 8, and Ubuntu 18.04 
LTS. https://github.com/hukkin/tomli/pull/134

--
nosy: +christian.heimes

___
Python tracker 

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



[issue46051] Make @atexit.register work for functions with arguments

2021-12-11 Thread quapka


New submission from quapka :

Hi folks!

Let me first present an example that motivated this issue. Imagine a script 
that builds Docker images and later starts them as Docker containers. To avoid 
having to stop the containers "manually" (in code and potentially forgot) I had 
an idea to register each container when started and stop each using atexit 
module. I chose to encapsulate this behavior inside a class. A much simplified 
example looks like this:

import atexit

class Program:
# keep a class level list of started containers
running_containers = []

@atexit.register
@classmethod
def clean_up(cls, *args, **kwargs):
for container in cls.running_containers:
print(f'stopping {container}')

def start_container(self, container):
print(f'starting {container}')
self.__class__.running_containers.append(container)

prog = Program()
a.start_container('container_A')
a.start_container('container_B')

And I'd expect this to produce:

starting container_A
starting container_B
stopping container_A
stopping container_B

To me, this reads rather nicely: the Program.clean_up method can be called by 
the user, but if he forgets it will be handled for him using atexit. However, 
this code does not work. :) I've spent some time debugging and what follows are 
my observations:

1) If the order of decorators is @atexit.register and then @classmethod then 
the code throws 'TypeError: the first argument must be callable'. I believe it 
is because classmethod and staticmethod are descriptors without the __call__ 
method implemented. atexit.register does not check this and instead of 
func.__func__ (which resolves to Program.clean_up) gets func (a classmethod) 
which is not callable 
(https://github.com/python/cpython/blob/main/Modules/atexitmodule.c#L147).

2) If the order of decorators is swapped (@classmethod and @atexit.register) 
then the code throws "Error in atexit._run_exitfuncs:\nTypeError: clean_up() 
missing 1 required positional argument: 'cls'". From my limited understanding 
of CPython and atexitmodule.c I think what happens is that the @atexit.register 
returns 
(https://github.com/python/cpython/blob/main/Modules/atexitmodule.c#L180) the 
func without the args and kwargs (since this issue 
https://bugs.python.org/issue1597824).

3) However, if I step away from decorating using @atexit.register and instead 
use

[...]
atexit.register(Program.clean_up) # <-- register post definition
prog = Program()
a.start_container('container_A')
a.start_container('container_B')

then the code works as expected and outputs:

starting container_A
starting container_B
stopping container_A
stopping container_B


To summarize, I don't like 3) as it puts the responsibility in a bit awkward 
place (good enough if I'm the only user, but I wonder about the more general 
library-like cases). My decorating skills are a bit dull now and it's my first 
time seriously looking into CPython internals - I've tried to encapsulate 
atexit.register in my custom decorator, to check whether that could be a 
workaround but overall was unsuccessful. In short, I'd say that in both 1) and 
2) the cls arg is lost when atexit calls the function. I've tried to dig it up 
from the func passed to atexit.register

def my_atexit_decorator(func, *args, **kwargs):
cls = # some magic with under attrs and methods
register.atexit(func, cls=cls, *args, **kwargs)
[...]

, but failed (it also felt like a fragile approach).

I was not able to understand why @atexit.register does not work when the 
function's signature is not empty. Also, if fixable I'm happy to actually put 
the effort into fixing it myself (looks like a nice first CPython PR), but I'd 
like to have someone else's opinion before I start marching in the wrong 
direction. Also, let me know if you'd like more details or code/tests I've 
produced while debugging this.

Cheers!

--
messages: 408321
nosy: quapka
priority: normal
severity: normal
status: open
title: Make @atexit.register work for functions with arguments
type: enhancement

___
Python tracker 

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



[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue28816] [doc] Clarify that zipimport does not invoke import hooks to load custom files from zip.

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28280
status: pending -> open
pull_request: https://github.com/python/cpython/pull/30060

___
Python tracker 

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



[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Don't worry, turns out it was a bit messier than I thought, so I prepared the 
PR. If you have some time, it would be great if you can take a quick look.

--

___
Python tracker 

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



[issue12833] Document the need to pass the prompt to raw_input() with readline

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-11 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

Oh no, I was about to open mine ;-)

https://github.com/python/cpython/compare/main...cfbolz:bpo-46042-syntax-error-range-duplicate-argument?expand=1

Basically equivalent, but I fixed the second bug too (would be very easy to add 
to yours)

--

___
Python tracker 

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



[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-11 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

ah, confused, seems you fixed them both too. will take a closer look!

--

___
Python tracker 

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



[issue24012] Add error checks to PyInit_pyexpat()

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

This is all sorted now:

iritkatriel@Irits-MBP cpython % grep "PyModule_AddObject(" Modules/pyexpat.c 
if (PyModule_AddObject(mod, name, submodule) < 0) {
if (PyModule_AddObject(errors_module, "codes", codes_dict) < 0) {
if (PyModule_AddObject(errors_module, "messages", rev_codes_dict) < 0) {
if (PyModule_AddObject(mod, "features", list) < 0) {
if (PyModule_AddObject(mod, "version_info", versionInfo) < 0) {
if (PyModule_AddObject(mod, "expat_CAPI", capi_object) < 0) {
iritkatriel@Irits-MBP cpython % grep "PyDict_SetItem(" Modules/pyexpat.c
PyDict_SetItem(self->intern, result, result) == 0)
else if (PyDict_SetItem(container, n, v)) {
int res = PyDict_SetItem(rev_codes_dict, num, str);
iritkatriel@Irits-MBP cpython % grep "PySys_GetObject(" Modules/pyexpat.c
iritkatriel@Irits-MBP cpython %

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



[issue24010] Add error checks to PyInit__locale()

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

This function now looks like this:

PyMODINIT_FUNC
PyInit__locale(void)
{
return PyModuleDef_Init(&_localemodule);
}

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



[issue46040] asyncio.coroutine documented as removed in 3.10

2021-12-11 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue35999] multpirocessing.Process alive after SIGTERM on parent

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

This example is not working for me on 3.11:

>>> from multiprocessing import Process
>>> from time import sleep
>>> from os import getpid
>>> 
>>> def log(daemon_mode):
... while True:
... print('worker %i %s' % (getpid(), daemon_mode))
... sleep(3)
... 
>>> 
>>> print('parent pid %i' % getpid())
parent pid 77378
>>> 
>>> a = Process(target=log, args=(0,), daemon=False)
>>> a.start()
>>> :744: DeprecationWarning: 
>>> BuiltinImporter.module_repr() is deprecated and slated for removal in 
>>> Python 3.12
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/iritkatriel/src/cpython-654/Lib/multiprocessing/spawn.py", line 
116, in spawn_main
exitcode = _main(fd, parent_sentinel)
   ^^
  File "/Users/iritkatriel/src/cpython-654/Lib/multiprocessing/spawn.py", line 
126, in _main
self = reduction.pickle.load(from_parent)
   ^^
AttributeError: Can't get attribute 'log' on 

--
nosy: +iritkatriel

___
Python tracker 

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



[issue14484] missing return in win32_kill?

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

That piece of code is still there, the function is now called os_kill_impl.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue46040] asyncio.coroutine documented as removed in 3.10

2021-12-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 991736697dff693b6c9f8964bb7540081bbf4ddb by Andrew Svetlov in 
branch '3.10':
[3.10] bpo-46040: Fix removal text for @asyncio.coroutine (GH-30061)
https://github.com/python/cpython/commit/991736697dff693b6c9f8964bb7540081bbf4ddb


--

___
Python tracker 

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



[issue46040] asyncio.coroutine documented as removed in 3.10

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



[issue27227] argparse fails to parse [] when using choices and nargs='*'

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, 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



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue37700] shutil.copyfile does not raise SpecialFileError for socket files

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, 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



[issue37701] shutil.copyfile raises SpecialFileError for symlink to fifo

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, 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



[issue27257] get_addresses results in traceback with an addrspec with an empty local part.

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

I am unable to reproduce this on 3.11:

>>> with open(b'lkml-exception.mail', mode = 'r') as f:
...  msg = email.message_from_file(f, policy=email.policy.SMTP)
... 
Traceback (most recent call last):
  File "", line 2, in 
AttributeError: module 'email' has no attribute 'policy'
>>> import email.policy
>>> with open(b'lkml-exception.mail', mode = 'r') as f:
...  msg = email.message_from_file(f, policy=email.policy.SMTP)
... 
>>> msg.get_all('to')
['unlisted-recipients:;, @pop.kundenserver.de']
>>>

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

___
Python tracker 

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



[issue26571] turtle regression in 3.5

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5

___
Python tracker 

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



[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2021-12-11 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11:

>>> import argparse
>>> parser = argparse.ArgumentParser(prog='PROG')
>>> 
>>> parser.add_argument('--badger', nargs='+')
_StoreAction(option_strings=['--badger'], dest='badger', nargs='+', const=None, 
default=None, type=None, choices=None, help=None, metavar=None)
>>> parser.add_argument('spam')
_StoreAction(option_strings=[], dest='spam', nargs=None, const=None, 
default=None, type=None, choices=None, help=None, metavar=None)
>>> parser.parse_args('--badger A B C D'.split())
usage: PROG [-h] [--badger BADGER [BADGER ...]] spam
PROG: error: the following arguments are required: spam

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3

___
Python tracker 

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



[issue34557] When sending binary file to a Microsoft FTP server over FTP TLS, the SSL unwind method hangs

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5, 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



[issue9504] signal.signal/signal.alarm not working as expected

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> out of date
stage: needs patch -> 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



[issue29221] ABC Recursion Error on isinstance() with less than recursion limit class hierarchy depth

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


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



[issue19459] Python does not support the GEORGIAN-PS charset

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, 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



[issue46005] [doc] replace 'distutils' examples with 'setuptools'

2021-12-11 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Or maybe we should just include 
https://github.com/python/cpython/blob/main/Doc/distutils/_setuptools_disclaimer.rst
 as others do?

I will send my proposal :)

--
nosy: +sobolevn

___
Python tracker 

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



[issue46005] [doc] replace 'distutils' examples with 'setuptools'

2021-12-11 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue40059] Provide a toml module in the standard library

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



[issue46043] Python Launcher Not Opening Files.

2021-12-11 Thread Nicholas Bond


Nicholas Bond  added the comment:

I am on macOS 12 and it still doesn't work when Terminal.app is open.

--

___
Python tracker 

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



[issue23948] Deprecate os.kill() on Windows

2021-12-11 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> rejected
stage: needs patch -> 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



[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-12-11 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> missing return in win32_kill?

___
Python tracker 

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



[issue44674] dataclasses should allow frozendict default value

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset e029c53e1a408b89a4e3edf30a9b38b094f9c880 by Eric V. Smith in 
branch 'main':
bpo-44674: Use unhashability as a proxy for mutability for default dataclass 
__init__ arguments. (GH-29867)
https://github.com/python/cpython/commit/e029c53e1a408b89a4e3edf30a9b38b094f9c880


--

___
Python tracker 

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



[issue44674] dataclasses should allow frozendict default value

2021-12-11 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue14484] missing return in win32_kill?

2021-12-11 Thread Eryk Sun


Eryk Sun  added the comment:

The details of os.kill() on Windows have been discussed extensively for years 
in various issues such as bpo-26350, bp-23948, and bp42962. But the problem of 
the missing return statement is always overwhelmed by discussion of the 
egregiously bad design of this function and its misuse, which depends on bugs 
in WinAPI GenerateConsoleCtrlEvent() when passed a PID that is not a process 
group ID and/or not attached to the console.

--
nosy: +eryksun

___
Python tracker 

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



[issue14484] missing return in win32_kill?

2021-12-11 Thread Eryk Sun


Change by Eryk Sun :


--
Removed message: https://bugs.python.org/msg408336

___
Python tracker 

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



[issue14484] missing return in win32_kill?

2021-12-11 Thread Eryk Sun


Eryk Sun  added the comment:

The details of os.kill() on Windows have been discussed extensively for years 
in various issues such as bpo-26350, bpo-23948, and bpo-42962. But the problem 
of the missing return statement is always overwhelmed by discussion of the 
egregiously bad design of this function and its misuse, which depends on bugs 
in WinAPI GenerateConsoleCtrlEvent() when passed a PID that is not a process 
group ID and/or not attached to the console.

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



[issue46024] Different behaviour with zipfile

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Actually, printing out:
print(repr(path), repr(ZipPath(path)))
would be more useful.

If I don't hear back in a few days, I'm going to close this issue.

--
status: pending -> open

___
Python tracker 

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



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2021-12-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
nosy: +serhiy.storchaka
nosy_count: 6.0 -> 7.0
pull_requests: +28283
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30063

___
Python tracker 

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



[issue45650] cgitb does not emit CGI headers when format='text'

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Having not heard back about a use case for this, I'm going to close it. If you 
want to move this forward, I suggest proposing it on the python-ideas mailing 
list.

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

___
Python tracker 

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



[issue44053] Can't connect to a server also not showing any type of output

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Closing due to lack of feedback.

--
resolution:  -> not a bug
stage:  -> resolved
status: pending -> closed
type:  -> behavior

___
Python tracker 

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



[issue24372] Documentation for ssl.wrap_socket's ssl_version parameter is odd

2021-12-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue44475] Dataclass Causes Infinite Recursion when using type of bytes

2021-12-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Closing due to lack of feedback.

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

___
Python tracker 

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



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is due to use functools.wraps(). If __all__ is not defined all non-builtin 
functions should have correct __module__ to be displayed by pydoc. 
functools.wraps() assigns __module__, __name__, __qualname__, __doc__ and 
__annotations__. __module__ should be preserved ('signal', not '_signal'), 
__name__ and __qualname__ are already correct, __annotations__ does not exist. 
So only __doc__ should be copied.

--

___
Python tracker 

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



[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 59435eea08d30796174552c0ca03c59b41adf8a5 by Pablo Galindo Salgado 
in branch 'main':
bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059)
https://github.com/python/cpython/commit/59435eea08d30796174552c0ca03c59b41adf8a5


--

___
Python tracker 

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



[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-11 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28284
pull_request: https://github.com/python/cpython/pull/30064

___
Python tracker 

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



[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue46042] Error range of "duplicate argument" SyntaxErrors is too big

2021-12-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Oh no, I was about to open mine ;-)

Sorry, Carl, I apologize. I hope it was not too disruptive to do the work. I 
was taking a look and I felt bad that the issue was probably messier than I 
thought and I didn't want you to have to iterate many times :(

Thanks a lot for helping review the PR and for pointing out the extra cases!!

--

___
Python tracker 

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



[issue9436] test_sysconfig failure: build a 32-bit Python a 64-bit OS

2021-12-11 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue46052] Ctrl+C, Ctrl+V in IDLE on Windows do not work with Cyrillic keyboard layout

2021-12-11 Thread Anton Bryl


New submission from Anton Bryl :

Ctrl+C and Ctrl+V key combinations in IDLE on Windows do not work with Cyrillic 
keyboard layout. It is unexpected, as well as inconvenient when editing string 
constants.

--
assignee: terry.reedy
components: IDLE
messages: 408345
nosy: anton.bryl, terry.reedy
priority: normal
severity: normal
status: open
title: Ctrl+C, Ctrl+V in IDLE on Windows do not work with Cyrillic keyboard 
layout
type: behavior
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



[issue37701] shutil.copyfile raises SpecialFileError for symlink to fifo

2021-12-11 Thread Eryk Sun


Eryk Sun  added the comment:

> Raising a SpecialFileError would be OK if `follow_symlinks` was False.

I expect it to fail if follow_symlinks is True, which is the default value. I 
expect it to succeed with follow_symlinks=False, which should create a shallow 
copy of just the symlink, regardless of its target. Instead, what happens is 
that it calls shutil._stat(fn) on both src and dst, regardless of 
follow_symlinks. I think the call should be shutil._stat(fn, follow_symlinks). 
This requires updating shutil._stat() to pass the value to fn.stat() and 
os.stat().

--
nosy: +eryksun

___
Python tracker 

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



[issue29221] ABC Recursion Error on isinstance() with less than recursion limit class hierarchy depth

2021-12-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is still reproducible if increase the depth. In 3.8-3.10 it needs 329 nested 
classes, in 3.11 -- 496.

Seems the limit is sys.getrecursionlimit()//k - 4, where k=4 in 3.7 and older, 
k=3 in 3.8-3.10, and k=2 in 3.11. It is much better than was initially, but the 
ideal is k=1.

--
resolution: out of date -> 
stage: resolved -> 
status: closed -> open
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, 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



[issue46032] functools' singledispatch does not support GenericAlias

2021-12-11 Thread Alex Waygood


Alex Waygood  added the comment:

The PR looks good to me. I think it's also important that we document that 
these types aren't supported, as it's not mentioned anywhere at the moment. 
Related: Issue34498.

--
nosy: +uriyyo

___
Python tracker 

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



[issue46053] NetBSD: ossaudio support incomplete

2021-12-11 Thread Thomas Klausner


New submission from Thomas Klausner :

When compiling Python on NetBSD, the ossaudio module is not enabled.
1. the code tries to export some #define that are not in the public OSS API 
(but that some other implementations provide)
2. on NetBSD, you need to link against libossaudio when using OSS

--
components: Extension Modules
messages: 408349
nosy: wiz
priority: normal
severity: normal
status: open
title: NetBSD: ossaudio support incomplete
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



  1   2   >