[issue47145] Improve graphlib.TopologicalSort by removing the prepare step

2022-03-29 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

> depends on an already-yielded node

I mean "creates a new not-yet-yielded dependency for an already-yielded node".

--

___
Python tracker 

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



[issue47145] Improve graphlib.TopologicalSort by removing the prepare step

2022-03-29 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Out of curiosity, what are the use cases for adding nodes after get_ready has 
already produced nodes?

I was wondering about avoiding the need to call prepare() by having it 
automatically do the cycle-checking at the first get_ready() call and then 
raising ValueError if add() is called any time thereafter.

Assuming we do want to be able to add() after a get_ready(), is there a reason 
that "forgetting" already-produced nodes is the correct behavior, as opposed to 
remembering all nodes ever added, and raising iff the addition creates a cycle 
among all nodes ever added or depends on an already-yielded node?

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue47152] Reorganize the re module sources

2022-03-29 Thread Ma Lin


Ma Lin  added the comment:

Please don't merge too close to the 3.11 beta1 release date, I'll submit PRs 
after this merged.

--

___
Python tracker 

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



[issue47157] bijective invertible map

2022-03-29 Thread Jonathan Balloch


Jonathan Balloch  added the comment:

thank you!!

On Tue, Mar 29, 2022 at 8:44 PM Raymond Hettinger 
wrote:

>
> Raymond Hettinger  added the comment:
>
> This is indeed a duplicate.  If needed just use one of implementations on
> PyPI https://pypi.org/project/bidict/
>
> --
> nosy: +rhettinger
> resolution:  -> duplicate
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-29 Thread Enji Cooper


Enji Cooper  added the comment:

Yup! Looks like it! Just needs a back port.

--

___
Python tracker 

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



[issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor

2022-03-29 Thread Logan Jones


Change by Logan Jones :


--
pull_requests: +30264
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32187

___
Python tracker 

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



[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-29 Thread Grégory Starck

Grégory Starck  added the comment:

I think this is fixed in main, thanks to this:

https://github.com/python/cpython/blob/main/Lib/logging/handlers.py#L862-L863

--
nosy: +gstarck

___
Python tracker 

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



[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-29 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Any possibility that you can test the attached PR as pid 1?

--

___
Python tracker 

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



[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-29 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue47156] IDLE: make use of extended SyntaxError info.

2022-03-29 Thread Andre Roberge


Andre Roberge  added the comment:

> (Anyone really want log of error?)

If by this you mean having access to the error from a known place (like 
sys.last_traceback or something else specific to IDLE but available from a 
script), then the answer from me is definitely yes.

--
nosy: +aroberge

___
Python tracker 

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



[issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor

2022-03-29 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

yep, branch off of a recent main.

--

___
Python tracker 

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



[issue47148] sys.path.append before import the module causing module don't have doc-string?

2022-03-29 Thread Rukchad Wongprayoon


Rukchad Wongprayoon  added the comment:

maybe try on windows? due to i did this on windows

--
status: pending -> open

___
Python tracker 

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



[issue47157] bijective invertible map

2022-03-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This is indeed a duplicate.  If needed just use one of implementations on PyPI 
https://pypi.org/project/bidict/

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



[issue32658] Metacharacter (\) documentation suggestion

2022-03-29 Thread Stanley


Stanley  added the comment:

Feel free, it's all yours

--

___
Python tracker 

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



[issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor

2022-03-29 Thread Logan Jones


Logan Jones  added the comment:

Okay, I'm actually able to work on this again. What is the best way to make 
this change real. Should I be working off of main?

--

___
Python tracker 

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



[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-29 Thread Enji Cooper


New submission from Enji Cooper :

Something I noticed when trying to repro another issue:

% python
Python 3.8.13 (default, Mar 16 2022, 17:28:59)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging.handlers
>>> logging.handlers.SysLogHandler(address=("something-completely-bogus-doncha-know",
>>>  514))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/logging/handlers.py", line 829, in __init__
ress = socket.getaddrinfo(host, port, 0, socktype)
  File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
>>>
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 2127, in shutdown
h.close()
  File "/usr/lib/python3.8/logging/handlers.py", line 892, in close
self.socket.close()
AttributeError: 'SysLogHandler' object has no attribute 'socket'
% python3.9
Python 3.9.11 (main, Mar 16 2022, 17:27:06)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging.handlers
>>> logging.handlers.SysLogHandler(address=("something-completely-bogus-doncha-know",
>>>  514))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/logging/handlers.py", line 873, in __init__
ress = socket.getaddrinfo(host, port, 0, socktype)
  File "/usr/lib/python3.9/socket.py", line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
>>>
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/__init__.py", line 2142, in shutdown
h.close()
  File "/usr/lib/python3.9/logging/handlers.py", line 936, in close
self.socket.close()
AttributeError: 'SysLogHandler' object has no attribute 'socket'

This is happening because logging.Handler is calling logging._addHandlerRef in 
logging.Handler.__init__ and _removeHandlerRef at exit via logging.shutdown(..).

--
components: Library (Lib)
messages: 416309
nosy: ngie
priority: normal
severity: normal
status: open
title: logging.handlers.SysLogHandler doesn't get cleaned up properly on exit 
if it throws an exception
type: behavior
versions: 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



[issue30479] improve asyncio debugging

2022-03-29 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

asyncio doesn't crash with scary messages like "AttributeError: 'NoneType' 
object has no attribute '_PENDING'" now.
Checked with Python 3.9+

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



[issue47157] bijective invertible map

2022-03-29 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

see also https://bugs.python.org/issue44931

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue30479] improve asyncio debugging

2022-03-29 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +asvetlov

___
Python tracker 

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



[issue47145] Improve graphlib.TopologicalSort by removing the prepare step

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

My personal usage of a topological sort are restricted to maybe 100 entries 
max, so I can't really test this in any meaningful way.

That, and the project that uses it is stuck on 3.6, so I haven't switched to 
the graphlib version yet.

--

___
Python tracker 

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



[issue43881] [doc] add platform availabity information for os.sched_getaffinity

2022-03-29 Thread Guo Ci Teo


Guo Ci Teo  added the comment:

`os.sched_getaffinity` is only available on some Unix platforms, as documented 
in
https://docs.python.org/dev/library/os.html#interface-to-the-scheduler
For example, on Windows we will get the error:
AttributeError: module 'os' has no attribute 'sched_getaffinity'

--

___
Python tracker 

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



[issue43881] [doc] add platform availabity information for os.sched_getaffinity

2022-03-29 Thread Irit Katriel


Change by Irit Katriel :


--
title: add platform availabity information for os.sched_getaffinity -> [doc] 
add platform availabity information for os.sched_getaffinity

___
Python tracker 

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



[issue47157] bijective invertible map

2022-03-29 Thread Jonathan Balloch


New submission from Jonathan Balloch :

It would be powerful to have a native implementation of a bijective map (e.g. a 
dictionary that hashed only one-to-one, but as a result either the "key" or the 
"value" could do lookup in O(1) time with the only overhead being the 
additional memory overhead of O(2N) as many references. 

Calling the object type "bimap", this could be easily implemented by simply 
having a call to bimap.inverse[value]=key, where the 'inverse' keyword is a 
reference table to the value-->key references. 

This is an important enhancement because currently the most efficient way to 
implement this is python is to, either: (1) make a custom object type that 
keeps two dictionaries, one that maps v->k and one that maps k->v, which takes 
twice as much memory, or (2) an object that has a custom "inverse" lookup call, 
which will be slower than O(1). In both cases there is no implicit enforcement 
of values being unique (necessary for a bijection). 

This should be added to the `collections` library as it will fit well along 
side other unique hashed collections such as "OrderedDict"

This will be beneficial to the community because transformations between 
semantic spaces (e.g. things that cannot be done in NumPy or similar) could be 
much more efficient and have cleaner, easier to read code if bijection maps 
were native and used one structure instead of two dictionaries.

--
components: Interpreter Core
messages: 416304
nosy: jon.balloch
priority: normal
severity: normal
status: open
title: bijective invertible map
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



[issue43881] add platform availabity information for os.sched_getaffinity

2022-03-29 Thread Irit Katriel


New submission from Irit Katriel :

It might help if you provide motivation for the change. In particular, explain 
why you believe the current text is incorrect.

--
nosy: +iritkatriel
versions: +Python 3.11 -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



[issue47156] IDLE: make use of extended SyntaxError info.

2022-03-29 Thread Terry J. Reedy


New submission from Terry J. Reedy :

In 3.10 and 3.11:

>>> while s := input.read(MAXBINSIZE):
... while len(s) < MAXBINSIZE and ns := input.read(MAXBINSIZE-len(s)):
  File "", line 2
while len(s) < MAXBINSIZE and ns := input.read(MAXBINSIZE-len(s)):
  ^^
SyntaxError: cannot use assignment expressions with expression

IDLE only colors the 'l' of 'len'; add extended marking.

Some other errors gained extended location in 3.11 (only, I believe).  Adding 
colors may require monkeypatching method or subclassing class in traceback.py.  
May have commented on issue or PR.

Related: Put SyntaxError in box.  (Anyone really want log of error?)

--
assignee: terry.reedy
components: IDLE
messages: 416302
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: make use of extended SyntaxError info.
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue26120] pydoc: move __future__ imports out of the DATA block

2022-03-29 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue26120] pydoc: move __future__ imports out of the DATA block

2022-03-29 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 63f32fae79e16e6dc71777bd3fcb623b2c3ff742 by Irit Katriel in 
branch 'main':
bpo-26120: do not exclude __future__ import in pydoc of the __future__ module 
itself (GH-32180)
https://github.com/python/cpython/commit/63f32fae79e16e6dc71777bd3fcb623b2c3ff742


--

___
Python tracker 

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



[issue42340] KeyboardInterrupt should come with a warning

2022-03-29 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks for the patch!

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



[issue42340] KeyboardInterrupt should come with a warning

2022-03-29 Thread miss-islington


miss-islington  added the comment:


New changeset c26af2bc531eb114c378cdad81935f6e838a7ee0 by Miss Islington (bot) 
in branch '3.9':
bpo-42340: Document issues around KeyboardInterrupt (GH-23255)
https://github.com/python/cpython/commit/c26af2bc531eb114c378cdad81935f6e838a7ee0


--

___
Python tracker 

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



[issue42340] KeyboardInterrupt should come with a warning

2022-03-29 Thread miss-islington


miss-islington  added the comment:


New changeset 66cde7c51a871a86cf8667adf4bd1d03e9b98eb1 by Miss Islington (bot) 
in branch '3.10':
bpo-42340: Document issues around KeyboardInterrupt (GH-23255)
https://github.com/python/cpython/commit/66cde7c51a871a86cf8667adf4bd1d03e9b98eb1


--

___
Python tracker 

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



[issue33178] Add support for BigEndianUnion and LittleEndianUnion in ctypes

2022-03-29 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks for the contribution!

(our attention spans can be scattered and random, apologies for the delay)

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



[issue33178] Add support for BigEndianUnion and LittleEndianUnion in ctypes

2022-03-29 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset dc2d8404a3ab6288ce112c71da8c65c34cd3087e by Dave Goncalves in 
branch 'main':
bpo-33178: Add BigEndianUnion, LittleEndianUnion classes to ctypes (GH-25480)
https://github.com/python/cpython/commit/dc2d8404a3ab6288ce112c71da8c65c34cd3087e


--

___
Python tracker 

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



[issue42340] KeyboardInterrupt should come with a warning

2022-03-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30262
pull_request: https://github.com/python/cpython/pull/32185

___
Python tracker 

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



[issue42340] KeyboardInterrupt should come with a warning

2022-03-29 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset d0906c90fcfbc4cfb9bb963eaa6bb152dd543b56 by benfogle in branch 
'main':
bpo-42340: Document issues around KeyboardInterrupt (GH-23255)
https://github.com/python/cpython/commit/d0906c90fcfbc4cfb9bb963eaa6bb152dd543b56


--
nosy: +JelleZijlstra

___
Python tracker 

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



[issue42340] KeyboardInterrupt should come with a warning

2022-03-29 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue47154] -arch detection in _osx_support generates false positives

2022-03-29 Thread Dominic Davis-Foster


Change by Dominic Davis-Foster :


--
nosy: +dom1310df

___
Python tracker 

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



[issue47152] Reorganize the re module sources

2022-03-29 Thread Dominic Davis-Foster


Dominic Davis-Foster  added the comment:

Could the sre_parse and sre_constants modules be kept with public names (i.e. 
without the leading underscore) but within the re namespace? I use them to 
tokenize and then syntax highlight regular expressions.

I did a quick search and found a few other users of the modules:

* pydoctor uses them for regex syntax highlighting[1], although it has its own 
copy of the sre_parse source rather than importing from stdlib.
* lark uses sre_parse to find minimum and maximum length of matching strings[2]
* sre_yield uses them to determine all strings that will match a regex[3]

The whole modules don't necessarily need exposing, but certainly 
sre_parse.parse, sre_parse.parse_template, and the opcodes from sre_constants 
would be the most useful.


[1] 
https://github.com/twisted/pydoctor/blob/c86273dffade5455890570142c8b7b068f5dffd1/pydoctor/epydoc/markup/_pyval_repr.py#L776
[2] 
https://github.com/lark-parser/lark/blob/85ea92ebf4e983e9997f9953a9c1463bb3d1c6cc/lark/utils.py#L120
[3] 
https://github.com/google/sre_yield/blob/3af063a0054c4646608b43b941fbfcbe4e01214a/sre_yield/__init__.py

--
nosy: +dom1310df

___
Python tracker 

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



[issue47138] Pin Jinja2 to fix docs build

2022-03-29 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +30260
pull_request: https://github.com/python/cpython/pull/32183

___
Python tracker 

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



[issue46197] ensurepip bootstrap breaks out of isolated environment

2022-03-29 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +eric.snow, gvanrossum

___
Python tracker 

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



[issue47155] Strange behavior on the tuple that includes list

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

There's also this StackOverflow question about it: 
https://stackoverflow.com/questions/38344244/tuples-operator-throws-exception-but-succeeds

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

___
Python tracker 

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



[issue47155] Strange behavior on the tuple that includes list

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is an FAQ: 
https://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works

--
nosy: +eric.smith

___
Python tracker 

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



[issue47155] Strange behavior on the tuple that includes list

2022-03-29 Thread Furkan Onder


New submission from Furkan Onder :

I am creating the tuple that includes a list and than I am trying to add new 
value to this list. Interpreter throw the error, but list is changing. I think 
it doesn't make sense. I think if we throw the type error, list shouldn't be 
change.

>>> tup = ('hi', 'test', ['a','b'])
>>> tup[2] += 'c'
Traceback (most recent call last):
File "", line 1, in 
TypeError: 'tuple' object does not support item assignment
>>> tup
('hi', 'test', ['a', 'b', 'c'])
>>>

--
components: Interpreter Core
messages: 416291
nosy: furkanonder
priority: normal
severity: normal
status: open
title: Strange behavior on the tuple that includes list
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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

> I blame the lack of standard POSIX functions for doing DNS lookups 
> asynchronously and in a way that provides TTL information to the client.

I totally agree with that!

And I agree it would be nice to have some way of doing non-blocking lookups 
when the TTL expires (or whenever it decides it needs to do a lookup). But it's 
going to be non-trivial, I fear.

--

___
Python tracker 

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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry


Bruce Merry  added the comment:

> Hmm. I'm not sure we should try to work around a bad resolver issue. What's 
> your platform, and how did you install Python?

Fair point. It's Ubuntu 20.04, running inside Docker, with the default Python 
(3.8). I've also reproduced it outside Docker (again Ubuntu 20.04 with system 
Python). The TTL is 30s, so I'm not sure why systemd-resolved isn't caching it 
for messages logged several times a second.

Even if the system has a local cache though, it's not ideal to have logging 
block when the TTL expires, particularly in an event-driven (asyncio) service. 
Updating the address in a background thread while continuing to log to the old 
address might be better. But my use case is particularly real-time (even 10ms 
of latency is problematic), and maybe that shouldn't drive the default 
behaviour.

I blame the lack of standard POSIX functions for doing DNS lookups 
asynchronously and in a way that provides TTL information to the client.

--

___
Python tracker 

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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

Hmm. I'm not sure we should try to work around a bad resolver issue. What's 
your platform, and how did you install Python?

--

___
Python tracker 

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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry


Bruce Merry  added the comment:

> Yes, that's what I mean. Isn't the resolver library smart enough to cache 
> lookups and handle the TTL timeout by itself?

Apparently not in this case - with tcpdump I can see the DNS requests being 
fired off several times a second. I'll need to check what the TTL actually is 
though.

--

___
Python tracker 

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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

> Do you mean expiring the IP address when the TTL is reached? 

Yes, that's what I mean. Isn't the resolver library smart enough to cache 
lookups and handle the TTL timeout by itself?

--

___
Python tracker 

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



[issue47138] Pin Jinja2 to fix docs build

2022-03-29 Thread Ned Deily


Ned Deily  added the comment:


New changeset d97497bf1cc6abd4a9a67d8da4f00cf13b3af4b3 by Steve Dower in branch 
'3.7':
bpo-47138: Ensure Windows docs build uses the same pinned version as other 
platforms (GH-32182)
https://github.com/python/cpython/commit/d97497bf1cc6abd4a9a67d8da4f00cf13b3af4b3


--

___
Python tracker 

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



[issue47138] Pin Jinja2 to fix docs build

2022-03-29 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +30259
pull_request: https://github.com/python/cpython/pull/32182

___
Python tracker 

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



[issue26120] pydoc: move __future__ imports out of the DATA block

2022-03-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Yet one bug: PR 30888 only changed the text output. But there is also the 
> html output generator.

Sorry, I was wrong. The changed code is common for all generators. Perhaps I 
tested with wrong version.

--

___
Python tracker 

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



[issue17246] inspect.getargvalues fails if arg name is not bound to a value

2022-03-29 Thread Maciej Górski

Maciej Górski  added the comment:

In my opinion formatargvalues function is quite useless in current day as 
ArgInfo provides all the information. I'm however willing to fix this. IMO we 
should just omit the args/varargs/kwargs that have been deleted, since the 
values do not exist in the current frame anymore.

I can implement the idea propossed in 2013, but I feel this seems less 
intuative(?) and might be worse for backwards compatibility (if anyone ever 
actually expects some values from formatargvalues, but I haven't been able to 
find an example of that).

Thank you in advance for any input.

--
nosy: +macgors

___
Python tracker 

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



[issue46775] [Windows] OSError should unconditionally call winerror_to_errno

2022-03-29 Thread Steve Dower


Steve Dower  added the comment:

Is this okay to backport? Correcting more winerror values means we'll get more 
subclasses raised instead of OSError (though only for obscure cases, which 
probably also aren't mapped, so I guess it's possible to prove that none will 
actually change right now).

--

___
Python tracker 

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



[issue46691] sysconfig.get_platform() raises ValueError on macOS if '-arch' is present in CFLAGS but doesn't refer to the '-arch' compiler flag

2022-03-29 Thread Ned Deily


Ned Deily  added the comment:

Also reported in bpo-47154 including a suggested fix

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> -arch  detection in _osx_support generates false positives

___
Python tracker 

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



[issue47154] -arch detection in _osx_support generates false positives

2022-03-29 Thread Ned Deily


Ned Deily  added the comment:

Duplicate of bpo-46691 but since you've provide a PR, we'll follow up with this 
one, thanks.

--
assignee:  -> ned.deily
components: +macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue26120] pydoc: move __future__ imports out of the DATA block

2022-03-29 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +30258
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32180

___
Python tracker 

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



[issue46564] Near zero-cost super().meth() calls via adaptive superinstructions

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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry

Bruce Merry  added the comment:

> If you don’t look it up every time, how do you deal with DNS timeouts?

Do you mean expiring the IP address when the TTL is reached? I suppose that 
could be an issue for a long-running service, and I don't have a good answer to 
that. Possibly these days with services meshes and load-balancers it is less of 
a concern since a logging server can move without changing its IP address.

But it's important for a logging system not to block the service doing the 
logging (which is one reason for using UDP in the first place). I only 
discovered this issue because of some flaky DNS servers that would occasionally 
take several seconds to answer a query, and block the whole asyncio event loop 
while it waited.

At a minimum it would be useful to document it, so that you know it's something 
to be concerned about when using DatagramHandler.

--

___
Python tracker 

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



[issue47153] __doc__ should generally be writable

2022-03-29 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue46775] [Windows] OSError should unconditionally call winerror_to_errno

2022-03-29 Thread Dong-hee Na


Change by Dong-hee Na :


--
keywords: +patch
nosy: +corona10
nosy_count: 5.0 -> 6.0
pull_requests: +30257
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32179

___
Python tracker 

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



[issue47154] -arch detection in _osx_support generates false positives

2022-03-29 Thread Isuru Fernando


Change by Isuru Fernando :


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

___
Python tracker 

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



[issue47154] -arch detection in _osx_support generates false positives

2022-03-29 Thread Isuru Fernando


New submission from Isuru Fernando :

If `cflags` contains something like, 
`-I/Users/isuru/handy-archives-env/include`, then the code assumes that there 
is a `-arch` flag in it and errors with 

ValueError: Don't know machine value for archs=()

--
components: Build
messages: 416278
nosy: isuruf
priority: normal
severity: normal
status: open
title: -arch  detection in _osx_support generates false positives
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



[issue47153] __doc__ should generally be writable

2022-03-29 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy: +scoder

___
Python tracker 

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



[issue47153] __doc__ should generally be writable

2022-03-29 Thread Antoine Pitrou


New submission from Antoine Pitrou :

The __doc__ attribute of several object types is not writable: notably 
descriptors (method/member/getset), as well builtin methods.

This is annoying when wanting to generate docstrings for these objects 
dynamically. While it's not useful for regular Python code, it comes up when 
using Cython, which uses these types to implement the methods and properties of 
"cdef" classes.

--
components: Interpreter Core
messages: 416277
nosy: pitrou
priority: normal
severity: normal
status: open
title: __doc__ should generally be writable
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



[issue26120] pydoc: move __future__ imports out of the DATA block

2022-03-29 Thread Irit Katriel


Irit Katriel  added the comment:

> Yet one bug: PR 30888 only changed the text output. But there is also the 
> html output generator.

I'm not sure - if I revert the change like this:

 if isinstance(getattr(obj, name, None), __future__._Feature):
-return False
+pass # return False


then test_html_doc fails:


==
FAIL: test_html_doc (test.test_pydoc.PydocDocTest.test_html_doc)
--
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython/Lib/test/test_pydoc.py", line 414, in 
test_html_doc
self.assertEqual(text_lines, expected_lines)

AssertionError: Lists differ: ['tes[1392 chars]t]', "print_function = 
_Feature((2, 6, 0, 'alp[156 chars]ody'] != ['tes[1392 chars]t]', 'type_union1 = 
typing.Union[int, str]', '[72 chars]ody']

First differing element 55:
"print_function = _Feature((2, 6, 0, 'alp[36 chars]576)"
'type_union1 = typing.Union[int, str]'

First list contains 1 additional elements.
First extra element 61:
'Nobody'

  ['test.pydoc_mod (version 1.2.3.4)',
   'This is a test module for test_pydoc',
   'Modules',
   'types',
   'typing',
   'Classes',
   'builtins.object',
   'A',
   'B',
   'C',
   'class A(builtins.object)',
   'Hello and goodbye',
   'Methods defined here:',
   '__init__()',
   'Wow, I have no function!',
   'Data descriptors defined here:',
   '__dict__',
   'dictionary for instance variables (if defined)',
   '__weakref__',
   'list of weak references to the object (if defined)',
   'class B(builtins.object)',
   'Data descriptors defined here:',
   '__dict__',
   'dictionary for instance variables (if defined)',
   '__weakref__',
   'list of weak references to the object (if defined)',
   'Data and other attributes defined here:',
   "NO_MEANING = 'eggs'",
   "__annotations__ = {'NO_MEANING': }",
   'class C(builtins.object)',
   'Methods defined here:',
   'get_answer(self)',
   'Return say_no()',
   'is_it_true(self)',
   'Return self.get_answer()',
   'say_no(self)',
   'Class methods defined here:',
   '__class_getitem__(item) from builtins.type',
   'Data descriptors defined here:',
   '__dict__',
   'dictionary for instance variables (if defined)',
   '__weakref__',
   'list of weak references to the object (if defined)',
   'Functions',
   'doc_func()',
   "This function solves all of the world's problems:",
   'hunger',
   'lack of Python',
   'war',
   'nodoc_func()',
   'Data',
   "__xyz__ = 'X, Y and Z'",
   'c_alias = test.pydoc_mod.C[int]',
   'list_alias1 = typing.List[int]',
   'list_alias2 = list[int]',
-  "print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), "
-  '1048576)',
   'type_union1 = typing.Union[int, str]',
   'type_union2 = int | str',
   'Author',
   'Benjamin Peterson',
   'Credits',
   'Nobody']

--

___
Python tracker 

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



[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-03-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks, let's close the issue as "won't fix".

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.2

2022-03-29 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Let's hold these PRs a couple of weeks in case more patch releases appear. IMO 
we can hold it until a week or two before the beta phase kicks in.

--

___
Python tracker 

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



[issue47083] The __complex__ method is missing from the complex, float, and int built-in types

2022-03-29 Thread Géry

Géry  added the comment:

> I think this may fine as-is.  In general, virtiual classes only promise that 
> an operation will work rather than promsing the presence of a particular 
> method.

Okay, I just wanted to make sure that the absence of the `__complex__` method 
was intended and not an oversight, since the built-in numeric types define 
*all* the other methods of the numbers ABCs.

--

___
Python tracker 

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



[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-03-29 Thread Géry

Géry  added the comment:

> On StackOverflow, there has been some mild interest in the interactions 
> between super() and classmethod():
> 
> * https://stackoverflow.com/questions/64637174
> * https://stackoverflow.com/questions/1269217
> * https://stackoverflow.com/questions/1817183

Another one: https://stackoverflow.com/q/15291302/2326961

--

___
Python tracker 

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



[issue47152] Reorganize the re module sources

2022-03-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-03-29 Thread Géry

Géry  added the comment:

Thanks for the review.

@rhettinger

> And adding classmethod() support in super_descr_get() would create tight 
> coupling where there should be separate concerns (no other descriptor call is 
> classmethod specific).

The descriptors `super`, `property`, and functions are already `classmethod` 
specific since their `__get__(instance, owner=None)` methods return `self` if 
`instance` is `None`, aren’t they?

> The OP's proposed use case is mildly plausible though I've never seen it the 
> arise in practice.

I agree that the parameterized factory method use case might be too rare to be 
compelling.

@gvanrossum

> That was perhaps a good idea 20 years ago, but nowadays you can use 
> argument-less super()

Yes this proposal is likely too late. I found your autosuper solution quite 
elegant (no compiler magic) so I wanted to make it work with `classmethod` too 
after I realized it doesn’t, thanks to Michele’s article.

--

___
Python tracker 

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



[issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior

2022-03-29 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue16958] The sqlite3 context manager does not work with isolation_level=None

2022-03-29 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10, erlendaasland

___
Python tracker 

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



[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-29 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
components: +Extension Modules -Library (Lib)
stage:  -> needs patch
title: vfork() returns EINVAL if PID=1 -> subprocess fails when used as init, 
vfork() returns EINVAL if PID=1
type:  -> behavior

___
Python tracker 

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



[issue47135] Allow decimal.localcontext to accept keyword arguments to set context attributes

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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith

Eric V. Smith  added the comment:

If you don’t look it up every time, how do you deal with DNS timeouts?

--
nosy: +eric.smith

___
Python tracker 

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



[issue23689] Memory leak in Modules/sre_lib.h

2022-03-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This looks promising. Please, go ahead! You are free to add any fields to any 
opcodes. It may break some third-party code which generates compiled patterns 
from a sequence of opcodes, it the stability of this interface was not 
promised. And they will be broken in any case due to reorganizing of internal 
code (issue47152).

--

___
Python tracker 

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



[issue47152] Reorganize the re module sources

2022-03-29 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

I proposed it several years ago on the Python-Dev mailing list and that change 
was approved in general. The reorganization was deferred because there were 
several known bugs in the RE engine (fixes for which could potentially be 
backported) and there were not merged patches waiting for review. Now the patch 
for atomic groups was merged and bugs was fixed (thanks to Ma Lin).

Both the C code and the Python code for the re module are distributed on few 
files, which lie down in directories Modules and Lib. It makes difficult to 
work with all related files because they are intermixed with source files of 
different modules.

The following changes are planned:

1. Convert the re module into a package. Make sre_* modules its submodules.
2. Move C sources for the _sre module into a separate directory.
3. Extract the code for generating definitions of C constants from definitions 
of Python constants into a separate script and add it in the Tools/scripts 
directory (there are precedences: generate_token.py, etc).

--
components: Library (Lib), Regular Expressions
messages: 416268
nosy: ezio.melotti, gvanrossum, malin, mrabarnett, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Reorganize the re module sources
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



[issue46864] Deprecate ob_shash in BytesObject

2022-03-29 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30254
pull_request: https://github.com/python/cpython/pull/32176

___
Python tracker 

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



[issue47102] explore hashlib use of the Linux Kernel CryptoAPI

2022-03-29 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30253
pull_request: https://github.com/python/cpython/pull/32176

___
Python tracker 

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



[issue9134] sre bug: lastmark_save/restore

2022-03-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Fixed in issue35859 together with other bugs, but the fix was only applied to 
3.11, because that bug is old and the old behavior matches the behavior in some 
other engines (Perl and Java).

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



[issue23689] Memory leak in Modules/sre_lib.h

2022-03-29 Thread Ma Lin


Ma Lin  added the comment:

My PR methods are suboptimal, so I closed them.

The number of REPEAT can be counted when compiling a pattern, and allocate a 
`SRE_REPEAT` array in `SRE_STATE` (with that number items).

It seem at any time, a REPEAT will only have one in active, so a `SRE_REPEAT` 
array is fine.
regex module does like this:
https://github.com/mrabarnett/mrab-regex/blob/hg/regex_3/_regex.c#L18287-L18288

Can the number of REPEAT be placed in `SRE_OP_INFO`?
And add a field to `SRE_OP_REPEAT` to indicate the index of this REPEAT.

--

___
Python tracker 

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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

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



[issue14265] Fully qualified test name in failure output

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



[issue14265] Fully qualified test name in failure output

2022-03-29 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 755be9b1505af591b9f2ee424a6525b6c2b65ce9 by Sam Ezeh in branch 
'main':
bpo-14265: Adds fully qualified test name to unittest output (GH-32138)
https://github.com/python/cpython/commit/755be9b1505af591b9f2ee424a6525b6c2b65ce9


--
nosy: +asvetlov

___
Python tracker 

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



[issue26120] pydoc: move __future__ imports out of the DATA block

2022-03-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yet one bug: PR 30888 only changed the text output. But there is also the html 
output generator.

--

___
Python tracker 

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



[issue26120] pydoc: move __future__ imports out of the DATA block

2022-03-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am sorry that I did not test the changes manually, but it seems that 
__future__ annotations are now disappeared from the pydoc output for the 
__future__ module help.

$ ./python -m pydoc __future__

It is now difficult to get a list of available features from the help.

They should be kept in the DATA section for the __future__ module.

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

___
Python tracker 

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



[issue47150] HTTPRedirectHandler fails on POST for 307 and 308

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



[issue35859] Capture behavior depends on the order of an alternation

2022-03-29 Thread Ma Lin


Ma Lin  added the comment:

Thanks for your review.

3.11 has a more powerful re module, also thank you for rebasing the atomic 
grouping code.

--

___
Python tracker 

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



[issue35859] Capture behavior depends on the order of an alternation

2022-03-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since the old behavior in many cases matches the behavior of Perl and Java 
(which are considered bugs, but still), it was decided to not backport the fix 
to avoid possible breakage in bugfix releases.

Thank you Ma Lin for your contribution.

--
components: +Library (Lib)
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 2.7, 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



[issue47151] vfork() returns EINVAL if PID=1

2022-03-29 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue35859] Capture behavior depends on the order of an alternation

2022-03-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 35699721a3391175d20e9ef03d434675b496 by Ma Lin in branch 
'main':
bpo-35859: Fix a few long-standing bugs in re engine (GH-12427)
https://github.com/python/cpython/commit/35699721a3391175d20e9ef03d434675b496


--

___
Python tracker 

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



[issue47151] vfork() returns EINVAL if PID=1

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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

2022-03-29 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> The C++20 "module" keyword is "contextual keyword". It's only a keyword if 
> the first line if a file contains "module".

Great! No changes needed. Thanks for investigating.

--

___
Python tracker 

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



[issue47148] sys.path.append before import the module causing module don't have doc-string?

2022-03-29 Thread Zachary Ware


Zachary Ware  added the comment:

I can't reproduce this without the `-OO` option:

-OO: do -O changes and also discard docstrings; add .opt-2 before
 .pyc extension


Note that I did slightly adjust your `b.py` script to do 
`print(a.multiply.__doc__)`, but here's what I tried:

~/issue47148_test/parent/another folder $ cat ../a.py 
def multiply():
"""multiply stuff"""
return 69*420
~/issue47148_test/parent/another folder $ cat b.py 
import sys
sys.path.append('..')
import a
print(a.multiply.__doc__)
~/issue47148_test/parent/another folder $ python b.py 
multiply stuff
~/issue47148_test/parent/another folder $ python -O b.py 
multiply stuff
~/issue47148_test/parent/another folder $ python -OO b.py 
None

--
nosy: +zach.ware
resolution:  -> works for me
status: open -> pending

___
Python tracker 

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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

2022-03-29 Thread STINNER Victor


STINNER Victor  added the comment:

The C++20 "module" keyword is "contextual keyword". It's only a keyword if the 
first line if a file contains "module".

* https://en.cppreference.com/w/cpp/language/modules#Module_declarations
* https://en.cppreference.com/w/cpp/keyword/module

It's not the case in any .h file of the Python C API, so Python doesn't need to 
be changed. I close the issue.

--
resolution:  -> not a bug
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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

2022-03-29 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote the draft PR GH-32175 to test https://bugs.python.org/issue39355 and 
GH-31282. Problem: I don't get any compiler warning or error about the "module" 
C++20 keyword. I tested GCC 11.2.1 and clang 13.0.0 of Fedora 35.

--

___
Python tracker 

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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

2022-03-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30252
pull_request: https://github.com/python/cpython/pull/32175

___
Python tracker 

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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

2022-03-29 Thread STINNER Victor


STINNER Victor  added the comment:

STINNER Victor:
> What is the error message? How can the error be reproduced?

Keith (aCuria):
> Compile with a compiler supporting the C++20 core feature (Modules)
> https://en.cppreference.com/w/cpp/compiler_support

I built a C++ extension which calls PyModule_AddType(): I get no warning. I 
tested GCC and LLVM clang.

Commands:

clang -Wno-unused-result -g -Og -Wall -O0 -fPIC 
-I/home/vstinner/python/main/Include -I/home/vstinner/python/main -c 
Modules/_testcppext.cpp -o 
build/temp.linux-x86_64-3.11-pydebug/Modules/_testcppext.o 
-I/home/vstinner/python -Werror -Wall -Wextra -Wconversion 
-Wno-typedef-redefinition -std=c++20 -Wzero-as-null-pointer-constant 
-Wold-style-cast

gcc -Wno-unused-result -g -Og -Wall -O0 -fPIC 
-I/home/vstinner/python/main/Include -I/home/vstinner/python/main -c 
Modules/_testcppext.cpp -o 
build/temp.linux-x86_64-3.11-pydebug/Modules/_testcppext.o 
-I/home/vstinner/python -Werror -Wall -Wextra -Wconversion 
-Wno-typedef-redefinition -std=c++20 -Wzero-as-null-pointer-constant 
-Wold-style-cast

Reformatted commands:

['clang',
 '-Wno-unused-result',
 '-g',
 '-Og',
 '-Wall',
 '-O0',
 '-fPIC',
 '-I/home/vstinner/python/main/Include',
 '-I/home/vstinner/python/main',
 '-c', 'Modules/_testcppext.cpp',
 '-o', 'build/temp.linux-x86_64-3.11-pydebug/Modules/_testcppext.o',
 '-I/home/vstinner/python',
 '-Werror',
 '-Wall',
 '-Wextra',
 '-Wconversion',
 '-Wno-typedef-redefinition',
 '-std=c++20',
 '-Wzero-as-null-pointer-constant',
 '-Wold-style-cast']

['gcc',
 '-Wno-unused-result',
 '-g',
 '-Og',
 '-Wall',
 '-O0',
 '-fPIC',
 '-I/home/vstinner/python/main/Include',
 '-I/home/vstinner/python/main',
 '-c', 'Modules/_testcppext.cpp',
 '-o', 'build/temp.linux-x86_64-3.11-pydebug/Modules/_testcppext.o',
 '-I/home/vstinner/python',
 '-Werror',
 '-Wall',
 '-Wextra',
 '-Wconversion',
 '-Wno-typedef-redefinition',
 '-std=c++20',
 '-Wzero-as-null-pointer-constant',
 '-Wold-style-cast']

--
versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

2022-03-29 Thread STINNER Victor


STINNER Victor  added the comment:

When I wrote a PR to use the C header file pythoncapi_compat.h in the datatable 
C++ project, I got multiple C++ compiler warnings in static inline functions 
and in some macros:
https://github.com/h2oai/datatable/pull/3231#issuecomment-1032864790

* Usage of NULL
* Usage of "old-style cast" like (ssize_t)1 or (PyObject*)obj

I solved this issue in pythoncapi_compat.h by using reinterpret_cast and 
nullptr:

* 
https://github.com/python/pythoncapi_compat/commit/347746379f79fa091017e23427932c9f9980234d
* https://github.com/python/pythoncapi_compat/pull/18
* https://github.com/h2oai/datatable/pull/3237

By the way, pythoncapi_compat.h no longer uses "module":
https://github.com/python/pythoncapi_compat/pull/22

The Python C API has similar issues, but warnings about NULL and old-style cast 
depend on the C++ compiler flags:

* -Wzero-as-null-pointer-constant
* -Wold-style-cast

--

___
Python tracker 

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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

2022-03-29 Thread STINNER Victor


STINNER Victor  added the comment:

If I build a C++ extension with -std=c++20, I get a compiler error on 
PyModuleDef_HEAD_INIT:

Modules/_testcppext.cpp:419:5: error: either all initializer clauses should be 
designated or none of them should be
  419 | .m_name = "_testcppext",
  | ^

Code:
---
static struct PyModuleDef module = {
PyModuleDef_HEAD_INIT,
.m_name = "_testcppext",
.m_doc = module_doc,
...
};
---

Macro defined as (simplified code):
---
#define PyObject_HEAD_INIT(type) \
{ 1, type },

#define PyModuleDef_HEAD_INIT { \
PyObject_HEAD_INIT(NULL)\
NULL, /* m_init */  \
0,/* m_index */ \
NULL, /* m_copy */  \
  }
---

--

___
Python tracker 

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



  1   2   >