[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset e064af564c8580285a76199229864ddfb1e50c0f by Miss Islington (bot) 
in branch '3.9':
bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)
https://github.com/python/cpython/commit/e064af564c8580285a76199229864ddfb1e50c0f


--

___
Python tracker 

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



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset d4a9e34401d519250d3b3744cd10394069f748c1 by Miss Islington (bot) 
in branch '3.10':
bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)
https://github.com/python/cpython/commit/d4a9e34401d519250d3b3744cd10394069f748c1


--

___
Python tracker 

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



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28964
pull_request: https://github.com/python/cpython/pull/30779

___
Python tracker 

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



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-21 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +28963
pull_request: https://github.com/python/cpython/pull/30778

___
Python tracker 

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



[issue46442] testExceptionCleanupNames doesn't test anything?

2022-01-21 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 82c53229e18f5853c82cb8ab6b9af1925a0e9e58 by Yellow Dusk in branch 
'main':
bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)
https://github.com/python/cpython/commit/82c53229e18f5853c82cb8ab6b9af1925a0e9e58


--

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread Kumar Aditya


Kumar Aditya  added the comment:

The following patch further reduces the reference but not sure if it is correct.

diff --git a/Objects/object.c b/Objects/object.c
index a5ee8eef4a..2ba6d14d5b 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1853,6 +1853,9 @@ static PyTypeObject* static_types[] = {
 _Type,
 _Type,
 _Type,
+_Type,
+_Type,
+_Type,
 _Type,
 _Type,
 _Type,
@@ -1911,6 +1914,13 @@ static PyTypeObject* static_types[] = {
 &_PyAsyncGenAThrow_Type,
 &_PyAsyncGenWrappedValue_Type,
 &_PyCoroWrapper_Type,
+&_PyHamt_Type,
+&_PyHamt_ArrayNode_Type,
+&_PyHamt_BitmapNode_Type,
+&_PyHamt_CollisionNode_Type,
+&_PyHamtKeys_Type,
+&_PyHamtValues_Type,
+&_PyHamtItems_Type,
 &_PyInterpreterID_Type,
 &_PyManagedBuffer_Type,
 &_PyMethodWrapper_Type,


Before:
Running Debug|x64 interpreter...
[4929 refs, 1988 blocks]
After:
Running Debug|x64 interpreter...
[4541 refs, 1853 blocks]

--
nosy: +kumaraditya303

___
Python tracker 

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



Re: A Newspaper for Python Mailing Lists

2022-01-21 Thread Abdur-Rahmaan Janhangeer
On the news side i was wrong as newsletters have been covering it since
long on a monthly basis, but not as in depth as it should be but awesome
job though. Else i have been going through early archives but the quality
of postings are not very great. The mailing lists have made awesome
progress over the years! Now the topics are very serious, the conversations
contribute much. Keep it up!

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__

2022-01-21 Thread Kumar Aditya


Change by Kumar Aditya :


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

___
Python tracker 

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



[issue46469] asyncio Generic classes should return GenericAlias in __class_getitem__

2022-01-21 Thread Kumar Aditya


New submission from Kumar Aditya :

In asyncio, the Generic classes return the class itself in __class_getitem__ 
instead of GenericAlias, because of this they cannot be introspected as 
GenericAlias objects.

Running Debug|x64 interpreter...
Python 3.11.0a4+ (main, Jan 22 2022, 10:00:18) [MSC v.1930 64 bit (AMD64)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> asyncio.Future

>>> asyncio.Future[int] 

>>> list

>>> list[int]
list[int]
>>> list[int].__args__
(,)
>>> asyncio.Future[int].__args__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: type object '_asyncio.Future' has no attribute '__args__'

--
messages: 411231
nosy: asvetlov, kumaraditya303, yselivanov
priority: normal
severity: normal
status: open
title: asyncio Generic classes should return GenericAlias in __class_getitem__
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



[issue46468] http.server documentation missing default value for port

2022-01-21 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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

___
Python tracker 

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



[issue46468] http.server documentation missing default value for port

2022-01-21 Thread Jelle Zijlstra


New submission from Jelle Zijlstra :

"python -m http.server" works and listens on port 8000, but the docs suggest 
you always have to pass the port. PR incoming.

--
assignee: Jelle Zijlstra
components: Documentation
messages: 411230
nosy: Jelle Zijlstra
priority: normal
severity: normal
status: open
title: http.server documentation missing default value for port
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



[issue46071] Graphlib documentation (edge direction)

2022-01-21 Thread David Mc Dougall


Change by David Mc Dougall :


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



[issue46454] '0 -> /dev/null' is lost

2022-01-21 Thread licunlong


licunlong  added the comment:

> File descriptors 0, 1, 2 are special: stdin, stdout and stderr file 
> descriptors. You should use stdin, stdout, and stderr parameter of subprocess.

I finally find why `fd 0` is inherited. The reason is that os.dup2() has a 
parameter "inheritable" which defaults to True. Not because it's special stdin.

I still think this is a bug. If some one closes fd 0, then he reopens it. it 
will not be inherited.

--

___
Python tracker 

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



[issue37093] http.client aborts header parsing upon encountering non-ASCII header names

2022-01-21 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2022-01-21 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

I think this should be fixed in typing.py instead. get_type_hints() should be 
less strict about what it accepts as a type, so users are free to use 
annotations in innovative ways.

Static type checkers should have the job of enforcing that type annotations are 
valid types.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue46467] Rounding 5, 50, 500 behaves differently depending on preceding value

2022-01-21 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

As documented, this is not a bug.

"if two multiples are equally close, rounding is done toward the even choice"

https://docs.python.org/3/library/functions.html#round

This is also called "Banker's Rounding" or "Round half to even" and for 
rounding many values, it minimizes the expected total rounding error.

https://en.wikipedia.org/wiki/Rounding#Round_half_to_even

--
nosy: +steven.daprano
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



[issue36643] Forward reference is not resolved by dataclasses.fields()

2022-01-21 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

I don't think we should merge this change. get_type_hints() is fragile and full 
of corner cases around using the right globals and locals dictionaries. 
dataclasses shouldn't execute it implicitly for you.

--
nosy: +Jelle Zijlstra
versions: +Python 3.11 -Python 3.7

___
Python tracker 

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



[issue46454] '0 -> /dev/null' is lost

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

> this fd 0 `is` inherited.

File descriptors 0, 1, 2 are special: stdin, stdout and stderr file 
descriptors. You should use stdin, stdout, and stderr parameter of subprocess.

Sorry but the bug tracker is not a good place to ask questions about how to use 
Python, it's only to report bugs.

Python works as expected.

--

___
Python tracker 

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



[issue46454] '0 -> /dev/null' is lost

2022-01-21 Thread licunlong


licunlong  added the comment:

But one more question.
Please take a look at fd.py. In this file, we first close fd 0, then open 
/dev/null as fd_null, and dump fd_null to fd 0. After we fork new process, this 
fd 0 `is` inherited.
This seems to be a bug?

--
nosy: +Geass-LL

___
Python tracker 

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



[issue46467] Rounding 5, 50, 500 behaves differently depending on preceding value

2022-01-21 Thread Spencer Brown


Spencer Brown  added the comment:

This is intentional behaviour, if the value is 5 it rounds towards even as 
documented here: https://docs.python.org/3/library/functions.html#round
The reason is so that if you have a bunch of random data, rounding won't 
slightly bias the result upward or downward.

--
nosy: +Spencer Brown

___
Python tracker 

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



[issue46467] Rounding 5, 50, 500 behaves differently depending on preceding value

2022-01-21 Thread Adam Ulrich


New submission from Adam Ulrich :

round(250,-2) returns 200
round(350,-2) returns 400
round(450,-2) returns 400
round(550,-2) returns 600
round(5,-1) returns 0
round(15,-1) returns 20
round(500,-3) returns 0
round(1500,-3) returns 2000

expected: round of 5 to consistently rounds up.

--
components: Interpreter Core
messages: 411222
nosy: adam.ulrich
priority: normal
severity: normal
status: open
title: Rounding 5,50,500 behaves differently depending on preceding value
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



[issue46466] help function reads comments

2022-01-21 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

That's not a bug.

https://docs.python.org/3/library/pydoc.html

"If there is no docstring, pydoc tries to obtain a description from the block 
of comment lines just above the definition of the class, function or method in 
the source file, or at the top of the module (see inspect.getcomments())."

--
nosy: +dam1784, steven.daprano
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



[issue46465] test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

Attached bug.py reproduces the bug without unittest, just run:

./python bug.py

On Python 3.10, it writes:
---
LOOP 0
LOOP 1
(...)
LOOP 14
LOOP 15
---

On the main branch, it fails with:
---
LOOP 0
LOOP 1
LOOP 2
LOOP 3
LOOP 4
LOOP 5
LOOP 6
LOOP 7
Traceback (most recent call last):
  File "/home/vstinner/bug.py", line 24, in 
Bug().run()
^^^
  File "/home/vstinner/bug.py", line 19, in run
raise Exception("bug")
^^
Exception: bug
---

--
Added file: https://bugs.python.org/file50575/bug.py

___
Python tracker 

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



[issue46465] test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

It's a regression introduced by the following change:

commit 3163e68c342434db37c69669017f96a4bb2d5f13
Author: Ken Jin <28750310+fidget-spin...@users.noreply.github.com>
Date:   Wed Oct 20 07:16:36 2021 +0800

bpo-44525: Specialize ``CALL_FUNCTION`` for C function calls (GH-26934)

--
keywords: +3.11regression
nosy: +Mark.Shannon, eric.snow, gvanrossum, kj
priority: normal -> release blocker

___
Python tracker 

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



[issue46466] help function reads comments

2022-01-21 Thread David Mc Dougall


Change by David Mc Dougall :


--
nosy:  -dam1784

___
Python tracker 

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



[issue46466] help function reads comments

2022-01-21 Thread David Mc Dougall


New submission from David Mc Dougall :

My inline comment ('#') got picked up by the help command.

Write the following code to a file (I named it "reproducer.py"):

"""

class Foo:
# Hello docstring, I'm a '#' comment!
def bar(self):
pass

assert Foo.bar.__doc__ is None
help(Foo.bar)

"""

The bug only happens when the file is executed.
$ python3 reproducer.py

Help on function bar in module __main__:

bar(self)
# Hello docstring, I'm a '#' comment!


Evaluating it at the interactive prompt does not reproduce the bug.
$ cat reproducer.py | python3

Help on function bar in module __main__:

bar(self)

--
messages: 411218
nosy: dam1784
priority: normal
severity: normal
status: open
title: help function reads comments
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



[issue46465] test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after TestBreak

2022-01-21 Thread STINNER Victor


New submission from STINNER Victor :

test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run after 
TestBreak:
-
$ ./python -m test -v test_unittest -R 3:3 -m 
'*TestBreak.testHandlerReplacedButCalled' -m '*TestBreak.testInstallHandler' -m 
'*TestBreakSignalDefault.testInstallHandler'
(...)
beginning 6 repetitions
123456
testHandlerReplacedButCalled (unittest.test.test_break.TestBreak) ... ok
testInstallHandler (unittest.test.test_break.TestBreak) ... ok
testInstallHandler (unittest.test.test_break.TestBreakSignalDefault) ... ok

--
Ran 3 tests in 0.003s

OK
(...)
.testHandlerReplacedButCalled (unittest.test.test_break.TestBreak) ... ok
testInstallHandler (unittest.test.test_break.TestBreak) ... ok
testInstallHandler (unittest.test.test_break.TestBreakSignalDefault) ... FAIL

==
FAIL: testInstallHandler (unittest.test.test_break.TestBreakSignalDefault)
--
Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/unittest/test/test_break.py", line 38, 
in testInstallHandler
self.assertTrue(unittest.signals._interrupt_handler.called)
^^^
AssertionError: False is not true
(...)
-

Or you can use a "bisect" file:
---
unittest.test.test_break.TestBreak.testHandlerReplacedButCalled
unittest.test.test_break.TestBreak.testInstallHandler
unittest.test.test_break.TestBreakSignalDefault.testInstallHandler
---

And the command:

./python -m test -v -F test_unittest --matchfile=bisect

Or the command:

./python -m test -v test_unittest -R 3:3 --matchfile=bisect

It fails starting at the 4th iteration.

--
components: Tests
messages: 411217
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_unittest: TestBreakSignalDefault.testInstallHandler() fails if run 
after TestBreak
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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28960
pull_request: https://github.com/python/cpython/pull/30775

___
Python tracker 

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



[issue46071] Graphlib documentation (edge direction)

2022-01-21 Thread Tim Peters


Tim Peters  added the comment:

> I know that there are many different ways to represent
> a graph, but your graph format *is just plain wrong.*

Yet when I offered to support an option to support the graph format you insist 
is uniquely "right", you poo-poo'ed the idea. So what is your real complaint? I 
don't know. Here you once again complain about the graph format, after 
rejecting an idea to address that directly.

Sorry, but you don't make sense to me. 

> if you're willing to rewrite all of the documentation you
> probably can explain this in a clear and simple way, and
> without breaking compatibility.

I don't see that happening. The docs are quite clear to me already, but I 
recognize that I'm too close to them to be objective about that. Instead I'm 
going on ample evidence from mailing lists, blogs, and StackOverflow that yours 
is the first complaint I've seen that the basic functionality here is any way 
unclear or ill-documented. People pick it up and use it productively at once. 
Nobody else has appeared to be confused.

Where things get unclear is limited to novel applications of multiprocessing. 
But people always stumble over multiprocessing, even for something as simple 
and bulletproof as a multiprocessing.Queue. Comes with the territory.

Finally, the distinction between "predecessors" and "dependencies" here strikes 
me as being uselessly pedantic. Nobody on the planet has an actual problem with 
recognizing that, e.g., "a" is predecessor of "n" in the string "pedantic". 
That's so in both technical language and plain English. Same here.

Still, if you want to rewrite the docs, go for out. I'll stay out of it 
completely.

--

___
Python tracker 

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



[issue46204] Graphlib documentation (general cleanup)

2022-01-21 Thread David Mc Dougall


Change by David Mc Dougall :


--
resolution:  -> wont fix
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



[issue46071] Graphlib documentation (edge direction)

2022-01-21 Thread David Mc Dougall


Change by David Mc Dougall :


--
nosy:  -dam1784

___
Python tracker 

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



[issue46071] Graphlib documentation (edge direction)

2022-01-21 Thread David Mc Dougall


David Mc Dougall  added the comment:

> It seems David places more value on the idea of the concrete mapping 
> "pointing forwards" with respect to the abstract directed graph, while it 
> seems Tim places more value on the idea of the abstract mapping direction 
> corresponding to the final static order. These two goals are in conflict, 
> assuming we don't want to change the behavior.

Yes, that's right. But the good news is that if you're willing to rewrite all 
of the documentation you probably can explain this in a clear and simple way, 
and without breaking compatibility.

I say *you* because I'm not going to argue with you all about this anymore, 
especially with Tim being...

---

Tim: you're conflating the words "predecessors" and "dependency".
In some contexts they can be synonymous, but they are not the same thing.
 * Predecessor refers to one of the sides of a directed edge.
 * Dependency refers to a semantic relationship between two of the users' 
things.



> The only possible topsort [...] For which see absolutely any text defining 
> the terms.

>From wiki: "Precisely, a topological sort is a graph traversal in which each 
>node v is visited only after all its dependencies are visited."

This definition doesn't say anything about the "predecessors" or how the graph 
is stored,
or anything about "edge direction". I like this definition.



> that's not a matter of preference, it's just plain wrong

I know that there are many different ways to represent a graph, but your graph 
format *is just plain wrong.*

Goodbye

--

___
Python tracker 

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



[issue46419] Incomplete Comparison to C++ Methods

2022-01-21 Thread Jorgen Harmse


Jorgen Harmse  added the comment:

Is van Rossum serious? I responded to the comments on my report. The action is 
to clarify the documentation, probably including a warning against multiple 
inheritance.

--

___
Python tracker 

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



[issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used

2022-01-21 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

For context, the fundamental problem is that os.fork() is unsafe to use in any 
process with threads.  concurrent/futures/process.py violates this.  So long as 
its design involves a thread, it can never be guaranteed not to deadlock.

POSIX forbids execution of most code after fork() has been called.  Returning 
to the CPython interpreter after os.fork() in the child process is never safe 
unless the parent process had no threads at fork time.

The change that triggered the issue moved from doing all of the os.fork() calls 
for the workers up front *before the thread was spawned* to doing them on 
demand after the thread was running.

The bugfix for this is simply a rollback to revert the bpo-39207 change. It was 
a performance enhancement, but it causes a new deadlock in code that didn't 
already have one when thread tuned malloc implementations are used.

The only way to safely launch worker processes on demand is to spawn a worker 
launcher process spawned prior to any thread creation that remains idle, with a 
sole job of spawn new worker processes for us. That sounds complicated. That'd 
be a feature. Lets go with the bugfix first.

--
assignee:  -> gregory.p.smith
keywords: +3.9regression
nosy: +gregory.p.smith
stage:  -> needs patch
type:  -> resource usage

___
Python tracker 

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



[issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal)

2022-01-21 Thread Eric Snow


Eric Snow  added the comment:

> the deep-frozen objects also reference the small ints directly, as well as 
> the singleton for b"".
> Is this even safe across Py_Finalize()/Py_Initialize()? If not, we'll need to 
> roll that back as well.

The small ints and the empty bytes object each have "immortal" refcounts too 
(9, just like you did in deepfreeze).  So they would cause a similar 
behavior to what Victor reported.  Otherwise I wouldn't expect any problems 
across Py_Finalize()/Py_Initialize().

--

___
Python tracker 

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



[issue29882] Add an efficient popcount method for integers

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset cd8de40b3b10311de2db7b90abdf80af9e35535f by Victor Stinner in 
branch 'main':
bpo-29882: _Py_popcount32() doesn't need 64x64 multiply (GH-30774)
https://github.com/python/cpython/commit/cd8de40b3b10311de2db7b90abdf80af9e35535f


--

___
Python tracker 

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



[issue42197] Disable automatic update of frame locals during tracing

2022-01-21 Thread Ned Batchelder


Ned Batchelder  added the comment:

And btw, the tests with that branch ran at least twice as fast as with 3.10!

--

___
Python tracker 

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



[issue46452] Possible false detection of Windows LZMA library as a malware by Avast

2022-01-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> third party
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



[issue39207] concurrent.futures.ProcessPoolExecutor does not properly reap jobs and spawns too many workers

2022-01-21 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

fyi - this appears to have caused https://bugs.python.org/issue46464

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue46421] unittest ValueError when invoking as module

2022-01-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +ezio.melotti, michael.foord, rbcollins

___
Python tracker 

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



[issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used

2022-01-21 Thread Yilei Yang


New submission from Yilei Yang :

When Python is built and linked with tcmalloc, using ProcessPoolExecutor may 
deadlock. Here is a reproducible example:

$ cat t.py
from concurrent import futures
import sys
def work(iteration, item):
  sys.stdout.write(f'working: iteration={iteration}, item={item}\n')
  sys.stdout.flush()
for i in range(0, 1):
with futures.ProcessPoolExecutor(max_workers=2) as executor:
executor.submit(work, i, 1)
executor.submit(work, i, 2)

$ python t.py
working: iteration=0, item=1
working: iteration=0, item=2
working: iteration=1, item=1
working: iteration=1, item=2
...
working: iteration=3631, item=1
working: iteration=3631, item=2


The child process fails to finish. It's more likely to reproduce when the 
system is busy.

With some bisect search internally, this commit 
https://github.com/python/cpython/commit/1ac6e379297cc1cf8acf6c1b011fccc7b3da2cbe
 "triggered" the deadlock threshold with tcmalloc.

--
components: Library (Lib)
messages: 411208
nosy: yilei
priority: normal
severity: normal
status: open
title: concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used
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



[issue40120] Undefined C behavior going beyond end of struct via a [1] arrays.

2022-01-21 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

off the top of my head that might actually work as I _think_ "empty" things are 
required to consume an unused byte of size no matter what meaning sizeof 
shouldn't change?  Some testing and standards perusing for C99 is in order to 
confirm that though.

--

___
Python tracker 

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



[issue46419] Incomplete Comparison to C++ Methods

2022-01-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

You appear more interested in a discussion of Python semantics than in 
improving the tutorial. I see nothing actionable here.

--
resolution:  -> wont fix
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



[issue29882] Add an efficient popcount method for integers

2022-01-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28959
pull_request: https://github.com/python/cpython/pull/30774

___
Python tracker 

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



[issue46419] Incomplete Comparison to C++ Methods

2022-01-21 Thread Jorgen Harmse


Jorgen Harmse  added the comment:

There may be more people who use Python, but there are strange semantics that 
cause problems even for experienced Python programmers. For example, 
assign-by-reference (apparently built without considering the solutions 
available in MatLab & R) frequently leads to unexpected changes in the caller's 
space. I expect that very few people understand linearisation, so multiple 
inheritance is effectively unusable in Python. C++ would generate a 
compile-time error if two base classes provided the same method (unless they 
inherited it from a common virtual base class).

The text in question appears twice in Section 9 of 
https://docs.python.org/3/tutorial/classes.html. It's in the third paragraph of 
the introduction and the 5th text paragraph of Section 9.5.

--

___
Python tracker 

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



[issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

2022-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset 46e6aad12958d3b73c5377ec034d056bb1a36d65 by Miss Islington (bot) 
in branch '3.10':
bpo-46445: Cover multiple inheritance of `TypedDict` in `test_typing` (GH-30719)
https://github.com/python/cpython/commit/46e6aad12958d3b73c5377ec034d056bb1a36d65


--

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ac1f152421fab3ac854fe4565c575b306e2bb4b5 by Victor Stinner in 
branch 'main':
bpo-46417: Use _PyType_CAST() in Objects directory (GH-30764)
https://github.com/python/cpython/commit/ac1f152421fab3ac854fe4565c575b306e2bb4b5


--

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7835cbf949c413a746324721a352cc72670a8a36 by Victor Stinner in 
branch 'main':
bpo-46417: Use _PyType_CAST() in Python directory (GH-30769)
https://github.com/python/cpython/commit/7835cbf949c413a746324721a352cc72670a8a36


--

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8ee07dda139f3fa1d7c58a29532a98efc790568d by Victor Stinner in 
branch 'main':
bpo-46417: Add _PyType_GetSubclasses() function (GH-30761)
https://github.com/python/cpython/commit/8ee07dda139f3fa1d7c58a29532a98efc790568d


--

___
Python tracker 

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



[issue46463] escape4chm.py script causing AttributeError in docs build

2022-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset b37f3e993a978eacf05c5fddd716be2d31f18a8d by Miss Islington (bot) 
in branch '3.9':
bpo-46463: Fixes escape4chm.py script used when building the CHM documentation 
file (GH-30768)
https://github.com/python/cpython/commit/b37f3e993a978eacf05c5fddd716be2d31f18a8d


--

___
Python tracker 

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



[issue46071] Graphlib documentation (edge direction)

2022-01-21 Thread Tim Peters


Tim Peters  added the comment:

Perhaps you've overlooking something so obvious to the module authors that I 
haven't thought to mention it?

The purpose here is to compute a linear order. Now not even you ;-) can pretend 
to be confused about what "predecessor" and "successor" mean in a linear order. 
There's no graph involved in the final result (unless you mentally impose a 
trivial linear graph on the result sequence).

And that's how to view the `graph` argument _as intended_. It maps an element 
to the elements that must precede it _in the result_. The element's mandatory 
predecessors in any acceptable imposed total ordering.

>From that intended view, this is just wy off base:

> I wish the docs started by saying:
>
> The graph is a dict of {'start_node': ['end_nodes',]}
> The topological sorter puts the end_nodes before their start_nodes.
>   [note: this is what the code currently does]

The words "start" and "end" there would be clearer as "banana" and "beeswax" 
;-) End of what? Start of what? The "start" node has to appear _after_ all the 
"end" nodes? In what other context does the "start" appear after the "end"?

As is, the code puts the "start" node after all its declared mandatory 
predecessors. Exactly as the word "predecessors" suggests should happen.


[Dennis]
> David suggests:
>
> * static_order returns [A, B]
> * Conceptual/abstract directed graph direction is B --> A
> * mapping to be passed is {B: [A]}

IF that's what he's suggesting (I don't know), that's not a matter of 
preference, it's just plain wrong. The only possible topsort of the DAG  B --> 
A is the sequence [B, A]. For which see absolutely any text defining the terms.

There are many ways the "mapping to be passed" could be defined. David is 
certainly right that, by convention, most graphs in Python are represented by 
successor dicts. But he apparently doesn't want an option for the topsorter to 
accept such a dict either. (An irony in passing: under the covers, the class 
converts the predecessor-dict `graph` argument to a successor-dict 
representation.)

At this point, I not only don't know what he wants, his position gets less 
clear to me over time.

--

___
Python tracker 

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



[issue46463] escape4chm.py script causing AttributeError in docs build

2022-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset d548c871716dfda73714d9f38b4e4219878a414e by Miss Islington (bot) 
in branch '3.10':
bpo-46463: Fixes escape4chm.py script used when building the CHM documentation 
file (GH-30768)
https://github.com/python/cpython/commit/d548c871716dfda73714d9f38b4e4219878a414e


--

___
Python tracker 

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



[issue46397] urllib.parse.quote uses safe='' as default

2022-01-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

'urlencode()' is a TypeError as a query (dict) is needed.  The claim is that 
'/?' in a key are encoded but should not be.  I verified the encoding in 3.10.

>>> urlencode({'/?link': 'pubmed'})  
'%2F%3Flink=pubmed'

https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode
https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote
and the following entry from 'quote_plus' say that by default, quote_via is 
quote_plus and the latter quotes '/' and '?'.  So the bug report as stated is 
not valid.
---

They also say that passing 'quote_via=quote' should suppress quoting of '/', 
because it defaults to 'safe='/', but it does not.

>>> urlencode({'/?link': 'pubmed'}, quote_via=quote)
'%2F%3Flink=pubmed'

So either the doc should be changed in 3 places, or the default safe for quote 
should be '/' as documented.
---

Anh, use safe='/?' to get what you want.

>>> urlencode({'/?link': 'pubmed'}, quote_via=quote, safe='/?')
'/?link=pubmed'

--
nosy: +orsenthil, terry.reedy
title: urllib.parse.urlencode() return wrong character -> urllib.parse.quote 
uses safe='' as default

___
Python tracker 

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



[issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value

2022-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset 9e3ff821dac05e8fde030ec83bd988f3eba66065 by Miss Islington (bot) 
in branch '3.9':
bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' 
(GH-30285)
https://github.com/python/cpython/commit/9e3ff821dac05e8fde030ec83bd988f3eba66065


--

___
Python tracker 

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



[issue32658] Metacharacter (\) documentation suggestion

2022-01-21 Thread Kevin Raeder


Kevin Raeder  added the comment:

Sure!  Thanks for paying attention to my suggestion.
Kevin

On Fri, Jan 21, 2022 at 10:42 AM mike mcleod  wrote:

>
> mike mcleod  added the comment:
>
> I would like to help with this issue. Is that acceptable?
>
> --
> nosy: +mikecmcleod
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue46124] Deprecation warning in zoneinfo module

2022-01-21 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Closing, presumed fixed. Please re-open if not.

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



[issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7

2022-01-21 Thread Christian Heimes


Christian Heimes  added the comment:

The comment about sched_[gs]etscheduler seems to be outdated. For one CPython's 
test suite has a @requires_sched decorator that performs a check for 
sched_getscheduler and the Kernel syscall. musl libc in Alpine 3.13 and 3.15 
have sched_setscheduler.

--

___
Python tracker 

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



[issue46463] escape4chm.py script causing AttributeError in docs build

2022-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28958
pull_request: https://github.com/python/cpython/pull/30773

___
Python tracker 

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



[issue46463] escape4chm.py script causing AttributeError in docs build

2022-01-21 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +28957
pull_request: https://github.com/python/cpython/pull/30772

___
Python tracker 

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



[issue46463] escape4chm.py script causing AttributeError in docs build

2022-01-21 Thread Steve Dower


Steve Dower  added the comment:


New changeset 57d1855682dbeb9233ef3a531f9535c6442e9992 by Steve Dower in branch 
'main':
bpo-46463: Fixes escape4chm.py script used when building the CHM documentation 
file (GH-30768)
https://github.com/python/cpython/commit/57d1855682dbeb9233ef3a531f9535c6442e9992


--

___
Python tracker 

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



[issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7

2022-01-21 Thread Christian Heimes


Christian Heimes  added the comment:

In my opinion we should treat these issues as Alpine / musl libc platform bugs 
and ask the Alpine maintainers to look into the issue. The tests are passing on 
Linux with glibc and BSD platforms (FreeBSD, macOS, ...) with BSD libc. It is 
reasonable to assume that failing test are caused by incompatibilities or 
deficiencies in musl libc, or by a different interpretation of POSIX and Open 
Group standards.

I would not ignore or skip any test unless we have a thorough understanding of 
the problem and the deviation is documented. The issue can also affect user 
code.

Python's test suite is exhaustive. Our tests have found a fair amount of 
problems in e.g, libm. A couple of years ago ine of my AF_ALG socket tests even 
found a Kernel bug by triggered a Kernel fault.

--

___
Python tracker 

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



[issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

2022-01-21 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

2022-01-21 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 65b88d5e01c845c0cfa3ff61bc8b2faec8f67a57 by Nikita Sobolev in 
branch 'main':
bpo-46445: Cover multiple inheritance of `TypedDict` in `test_typing` (GH-30719)
https://github.com/python/cpython/commit/65b88d5e01c845c0cfa3ff61bc8b2faec8f67a57


--

___
Python tracker 

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



[issue46396] Typing: test invalid usages of `Concatenate`

2022-01-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

Arguably the runtime should not check for incorrect calls to Concatenate. 
That's the job of static type checkers. So maybe that code could just be 
removed? (We don't bother checking things like list[0] either.)

--

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28955
pull_request: https://github.com/python/cpython/pull/30767

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28954
pull_request: https://github.com/python/cpython/pull/30769

___
Python tracker 

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



[issue46463] escape4chm.py script causing AttributeError in docs build

2022-01-21 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7

2022-01-21 Thread Christian Heimes


Change by Christian Heimes :


Removed file: https://bugs.python.org/file50562/alpine315-tests.txt

___
Python tracker 

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



[issue46396] Typing: test invalid usages of `Concatenate`

2022-01-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Invalid usage of `Concatenate` is not covered at all -> Typing: test 
invalid usages of `Concatenate`

___
Python tracker 

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



[issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value

2022-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28952
pull_request: https://github.com/python/cpython/pull/30766

___
Python tracker 

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



[issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value

2022-01-21 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value

2022-01-21 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 881a763cfe07ef4a5806ec78f13a9bc99e8909dc by Weipeng Hong in 
branch 'main':
bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' 
(GH-30285)
https://github.com/python/cpython/commit/881a763cfe07ef4a5806ec78f13a9bc99e8909dc


--
nosy: +gvanrossum

___
Python tracker 

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



[issue46390] Multiple test failures on Alpine 3.15 / musl-1.2.2-r7

2022-01-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The first alpine315-tests.txt appears to be a truncated version of the second.  
Were you expecting the first to be automatically replaced?  Should it be 
unlinked?

https://www.alpinelinux.org "Alpine Linux is a security-oriented, lightweight 
Linux distribution based on musl libc and busybox."  Fron the doc linked above:

# Maintainer: Natanael Copa   ## I nosied Natanael at 
his CLA-signed Alpine id.
# Contributor: Sheila Aman 
...
# musl related
fail="test__locale test_locale test_strptime test_re"   # various musl 
locale deficiencies
fail="$fail test_c_locale_coercion"
fail="$fail test_datetime"  # hangs if 
'tzdata' installed
fail="$fail test_os"# fpathconf, 
ttyname errno values
fail="$fail test_posix" # 
sched_[gs]etscheduler not impl
fail="$fail test_shutil"# lchmod, 
requires real unzip

Should we change CPython tests to accommodate things that are missing (versus 
buggy).  Should the tests requiring sched_[gs]etscheduler be skipped if 
missing?  Or are they required to be 'posix' and is test_posix meant to test 
completeness as well as correctness of what is present?

--
nosy: +ncopa, terry.reedy

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28950
pull_request: https://github.com/python/cpython/pull/30764

___
Python tracker 

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



[issue46419] Incomplete Comparison to C++ Methods

2022-01-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

Just because __init__ is extra weird doesn't mean that other methods aren't 
roughly like C++.

But I can't find the text the OP refers to. Without a specific pointer (at 
least a URL and quoted text) this issue is non-actionable and should probably 
be closed.

--

___
Python tracker 

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



[issue46124] Deprecation warning in zoneinfo module

2022-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset 00b2b578bd9e516d601063a086b03177f546bcdd by Jason R. Coombs in 
branch 'main':
bpo-46124: Update zoneinfo to rely on importlib.resources traversable API. 
(GH-30190)
https://github.com/python/cpython/commit/00b2b578bd9e516d601063a086b03177f546bcdd


--
nosy: +miss-islington

___
Python tracker 

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



[issue44975] [typing] Runtime protocols with ClassVar data members should support issubclass

2022-01-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

IMO we shouldn't update PEP 544. PEPs reflect the historical proposal, they are 
not documentation for the current state of the interpreter.

--

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28949
pull_request: https://github.com/python/cpython/pull/30763

___
Python tracker 

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



[issue46071] Graphlib documentation (edge direction)

2022-01-21 Thread Dennis Sweeney

Dennis Sweeney  added the comment:

I think I can summarize:

Tim + Current Docs:

* static_order to return [A, B]
* Conceptual/abstract directed graph direction is A --> B
* A is a predecessor of B
* predecessor mapping to be passed is {B: [A]}

David suggests:

* static_order returns [A, B]
* Conceptual/abstract directed graph direction is B --> A
* mapping to be passed is {B: [A]}

It seems David places more value on the idea of the concrete mapping "pointing 
forwards" with respect to the abstract directed graph, while it seems Tim 
places more value on the idea of the abstract mapping direction corresponding 
to the final static order. These two goals are in conflict, assuming we don't 
want to change the behavior.

I think I agree more with Tim, since abstract graphs can be represented in lots 
of ways (set of pairs? adjacency matrix or its transpose? adjacency list/dict? 
Bi-directional mapping?), so the translation from the abstract to the concrete 
is a decent place for the "reversal".

It's very very standard for a topological sort to be conceptualized as taking a 
picture like
A → B
↓   ↓
C → D
and transforming it into a list/iterator like [A, B, C, D], and I think the 
conceptual consistency there should be preserved, even if the concrete 
representation of the abstract graph "points backwards".

--

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bc67f189fdd62ed42013fa05cd0ef2df498f5967 by Victor Stinner in 
branch 'main':
bpo-46417: Add _PyType_CAST() macro (GH-30760)
https://github.com/python/cpython/commit/bc67f189fdd62ed42013fa05cd0ef2df498f5967


--

___
Python tracker 

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



[issue24711] Document getpass.getpass behavior on ^C

2022-01-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

In IDLE Shell, with either ^C or ^D,

>> try:
... input('??')
... except:
... 'done'
... 
... 
??
'done'

'getpass.getpass('??') does same after printing warning from line 100 that 
fallback_getpass is being used.  The newline may be supplied by IDLE, not sure.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue46463] escape4chm.py script causing AttributeError in docs build

2022-01-21 Thread Steve Dower


New submission from Steve Dower :

Exception occurred:
  File "D:\a\1\s\Doc\tools\extensions\escape4chm.py", line 44, in fixup_keywords
with app.builder.open_file(outdir, outname + '.hhk', 'r') as f:
AttributeError: 'HTMLHelpBuilder' object has no attribute 'open_file'
The full traceback has been saved in 
C:\Users\VSSADM~1\AppData\Local\Temp\sphinx-err-9ikx8s0b.log, if you want to 
report the issue to the developers.
Please also report this if it was a user error, so that a better error message 
can be provided next time.
A bug report can be filed in the tracker at 
. Thanks!

--
assignee: steve.dower
components: Build, Documentation
messages: 411180
nosy: steve.dower
priority: normal
severity: normal
status: open
title: escape4chm.py script causing AttributeError in docs build
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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28948
pull_request: https://github.com/python/cpython/pull/30761

___
Python tracker 

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



[issue46071] Graphlib documentation (edge direction)

2022-01-21 Thread David Mc Dougall


David Mc Dougall  added the comment:

No, the code works fine. I just wish the docs weren't so muddled.

I wish the docs started by saying:

> The graph is a dict of {'start_node': ['end_nodes',]}
> The topological sorter puts the end_nodes before their start_nodes.
   [note: this is what the code currently does]

Then the docs could introduce and use different terminology: "tasks" and their 
"dependencies".
Everyone understands what those are.


And nowhere does it need to say the word "predecessors".


But honestly, I think I'm going to throw in the towel and give up on this 
endeavor.

--

___
Python tracker 

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



[issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs

2022-01-21 Thread mxmlnkn


mxmlnkn  added the comment:

I think you misunderstood. foo.txt is a file, which actually exists but 
contains non-TAR data. E.g. try:

base64 /dev/urandom | head -c $(( 2048 ))  > foo.txt
python3 -c 'import tarfile; print(list(tarfile.open("foo.txt")))'

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/tarfile.py", line 1616, in open
raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

python3 -c 'import tarfile; print(list(tarfile.open("foo.txt", 
ignore_zeros=True)))'

[]

--
status: pending -> open

___
Python tracker 

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



[issue42197] Disable automatic update of frame locals during tracing

2022-01-21 Thread Ned Batchelder


Ned Batchelder  added the comment:

I ran the coverage.py test suite using 
https://github.com/faster-cpython/cpython/tree/dont-fast-to-locals-in-trampoline,
 and there were no failures.

--

___
Python tracker 

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



[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28947
pull_request: https://github.com/python/cpython/pull/30760

___
Python tracker 

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



[issue46434] pdb help fails with AttributeError when using Windows embeddable package

2022-01-21 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the contribution!

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



[issue46434] pdb help fails with AttributeError when using Windows embeddable package

2022-01-21 Thread miss-islington


miss-islington  added the comment:


New changeset 05063fa15c594012e6dc9c2c7a3ea72e7cb933f2 by Miss Islington (bot) 
in branch '3.10':
bpo-46434: Handle missing docstrings in pdb help (GH-30705)
https://github.com/python/cpython/commit/05063fa15c594012e6dc9c2c7a3ea72e7cb933f2


--

___
Python tracker 

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



[issue46439] Clarify urllib.request.add_header documentation

2022-01-21 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

Yes -- additionally, since other http libraries (I believe) usually don't 
forward headers on redirections by default, the default for urllib.request is 
counterintuitive (and maybe even not ideal for security reasons?) and would 
benefit from additional clarification.

--

___
Python tracker 

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



[issue46439] Clarify urllib.request.add_header documentation

2022-01-21 Thread Éric Araujo

Éric Araujo  added the comment:

I think the doc assumes that people will expect headers to be added for 
redirections, and if not the existence of the method `add_unredirected_header` 
that’s documented just after would tell it.

That said, the addition does no harm, so why not be explicit.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue46419] Incomplete Comparison to C++ Methods

2022-01-21 Thread Éric Araujo

Éric Araujo  added the comment:

Maybe the reference should be removed entirely!  Nowadays there may be more 
people knowing Python and how its methods work than C++.

--
nosy: +eric.araujo, gvanrossum

___
Python tracker 

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



[issue46434] pdb help fails with AttributeError when using Windows embeddable package

2022-01-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28946
pull_request: https://github.com/python/cpython/pull/30759

___
Python tracker 

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



[issue46455] Deprecate / remove os.name=java

2022-01-21 Thread Éric Araujo

Change by Éric Araujo :


--
versions:  -Python 3.10, 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



[issue46462] Email Header Folding Converts Non-CRLF Newlines to CRLFs

2022-01-21 Thread J. Walter Clark


New submission from J. Walter Clark :

In various places in the email library `str.splitlines` is used to split up a 
message where folding might take place in the original message source. This 
appears to be a bug because when these split parts are re-joined they are 
joined by a CRLF.
https://github.com/python/cpython/blob/ef5bb25e2d6147cd44be9c9b166525fb30485be0/Lib/email/header.py#L369

`str.splitlines` splits on "universal newlines" which can include newlines 
other than the CRLF.
https://docs.python.org/3/library/stdtypes.html#str.splitlines

However, the email RFCs define folding whitespace with CRLF as the only 
possible newline type (optionally surrounded by WSP (SP/HTAB) and/or comments).
https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.2

The end result is that a message making a roundtrip through the email 
parser/generator is mangled because it has any non-CRLF "universal newlines" 
converted to CRLFs. Anything in the header after the non-CRLF "universal 
newline" appears on it's own line with no preceding whitespace. This appears to 
happen with all of the stock policies.

```
from email import message_from_bytes
from email.policy import SMTPUTF8

eml_bytes = b'Header-With-FS-Char: BEFORE\x1cAFTER\r\n\r\nBody\r\n'
print(eml_bytes)

message = message_from_bytes(eml_bytes, policy=SMTPUTF8)
print(message.as_bytes(policy=SMTPUTF8))
```

```
b'Header-With-FS-Char: BEFORE\x1cAFTER\r\n\r\nBody\r\n'
b'Header-With-FS-Char: BEFORE\r\nAFTER\r\n\r\nBody\r\n'
```

The operational impact of this mangling is that the "AFTER" text now makes the 
message format invalid because it is neither a valid header (no ": ") nor the 
valid start of a message body (only one CRLF). Common MIME-viewers (e.g. 
Thunderbird/Outlook) appear to interpret it as a body anyway and any subsequent 
headers become part of the body.

--
components: Library (Lib)
messages: 411171
nosy: jwalterclark
priority: normal
severity: normal
status: open
title: Email Header Folding Converts Non-CRLF Newlines to CRLFs
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



[issue46461] Kodi crashing

2022-01-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

Without a way to reproduce this, we won't be able to help you.

Ideally you would provide a python script, which we could run, which shows the 
problem. It would be best if there were no third party packages involved, but 
if there are, you should provide instructions on how to set up a virtual 
environment that includes whatever software you need.

--
nosy: +eric.smith

___
Python tracker 

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



[issue46461] Kodi crashing

2022-01-21 Thread Patric Gustavsson


Patric Gustavsson  added the comment:

EDIT, just upgraded to ubuntu 21.10 and now use python 3.10.0 , same issue.

--

___
Python tracker 

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



[issue40120] Undefined C behavior going beyond end of struct via a [1] arrays.

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

#ifdef __cplusplus
char array[1];
#else
char array[];
#endif

Does it change the size of the structure between C and C++, 
sizeof(PyBytesObject)? Also, does the size of the struture matter? :-) I guess 
that the impart part is the ABI: offset of the members.

--

___
Python tracker 

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



[issue46433] _PyType_GetModuleByDef optimization is incorrect

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

An alternative would be to merge PyHeapTypeObject members into PyTypeObject. I 
don't get why there is a separated struture: PyTypeObject is excluded from the 
stable ABI. See my remark about that:
https://bugs.python.org/issue22079#msg391464

Having a separated structure just static types make the code more complex and 
more error prone.

--

___
Python tracker 

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



[issue46433] _PyType_GetModuleByDef optimization is incorrect

2022-01-21 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, it seems like I misunderstood type_ready_mro() change. The check is only 
done on static types type. The MRO of heap types is not checked.

--

In my change, I wrote:

// _PyType_GetModuleByDef() must only be called on a heap type created
// by PyType_FromModuleAndSpec() or on its subclasses.
// type_ready_mro() ensures that a static type cannot inherit from a
// heap type.

based on this function:

static int
type_ready_mro(PyTypeObject *type)
{
/* Calculate method resolution order */
if (mro_internal(type, NULL) < 0) {
return -1;
}
assert(type->tp_mro != NULL);
assert(PyTuple_Check(type->tp_mro));

/* All bases of statically allocated type should be statically allocated */
if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) {
PyObject *mro = type->tp_mro;
Py_ssize_t n = PyTuple_GET_SIZE(mro);
for (Py_ssize_t i = 0; i < n; i++) {
PyTypeObject *base = (PyTypeObject *)PyTuple_GET_ITEM(mro, i);
if (PyType_Check(base) && (base->tp_flags & Py_TPFLAGS_HEAPTYPE)) {
PyErr_Format(PyExc_TypeError,
 "type '%.100s' is not dynamically allocated but "
 "its base type '%.100s' is dynamically allocated",
 type->tp_name, base->tp_name);
return -1;
}
}
}
return 0;
}

This code comes from bpo-22079:

commit e09bcc874a21ce351a7fe73b9a137e236550d03c
Author: Serhiy Storchaka 
Date:   Wed Jan 28 11:03:33 2015 +0200

Issue #22079: PyType_Ready() now checks that statically allocated type has
no dynamically allocated bases.

Rationale: https://bugs.python.org/issue22079#msg236830

--

Note: PyType_Ready() function was very big and complex. I splitted this huge 
function into sub-functions in bpo-43770. I hope that it's a little bit more 
readable yet. I tried but failed to find a bug about tp_getattro and 
tp_setattro inheritance

--

___
Python tracker 

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



  1   2   3   >