[issue46796] Simplify handling of removed parameter "loop" in asyncio

2022-02-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue46796] Simplify handling of removed parameter "loop" in asyncio

2022-02-18 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Before 3.10 many asyncio classes did have an optional parameter "loop". It was 
deprecated in 3.8. To simplify the code, such classes inherited a constructor 
from _LoopBoundMixin which set the _loop attribute and (since 3.8) emitted a 
warning if the loop argument was passed. Since 3.10 the _LoopBoundMixin no 
longer sets the _loop attribute and always raises a TypeError if the loop 
argument is passed.

The same effect can be achieved if just remove the loop parameter (and the 
_LoopBoundMixin constructor as it will do nothing). The only difference in the 
error message: it will be standard "Lock.__init__() got an unexpected keyword 
argument 'loop'" instead of "As of 3.10, the *loop* parameter was removed from 
Lock() since it is no longer necessary". Usually we do not keep specialized 
error messages for removed parameters.

--
components: asyncio
messages: 413539
nosy: asvetlov, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Simplify handling of removed parameter "loop" in asyncio
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



[issue46757] dataclasses should define an empty __post_init__

2022-02-18 Thread Vedran Čačić

Vedran Čačić  added the comment:

That "except AttributeError" approach is a powerful bug magnet, since it can 
very easily mask real attribute errors stemming from misspelled attribute names 
in the __post_init__ call itself. What you should _really_ do is

def __post_init__(self):
with contextlib.suppress(AttributeError):
post_init = super().__post_init__
post_init()

But of course, nobody will ever write that.

Raymond in his "super considered super" video 
(https://youtu.be/xKgELVmrqfs?t=2068) says the right thing to do is to make 
your own root which knows exactly what classes it manages, and drops the 
supercalls from them (after possibly verifying that all kwargs have actually 
been used and so on).

But in case of dataclasses, usually any class can serve as such a root, and the 
main reason people use dataclasses is to avoid boilerplate code. So I think it 
would be a nice compromise.

--
nosy: +veky

___
Python tracker 

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



[issue46757] dataclasses should define an empty __post_init__

2022-02-18 Thread Nikita Sobolev


Change by Nikita Sobolev :


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



[issue24053] Define EXIT_SUCCESS and EXIT_FAILURE constants in sys

2022-02-18 Thread Stefan Behnel


Stefan Behnel  added the comment:

> Any reasons the PR still not merged?

There was dissent about whether these constants should be added or not. It 
doesn't help to merge a PR that is not expected to provide a benefit.

--

___
Python tracker 

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



[issue46757] dataclasses should define an empty __post_init__

2022-02-18 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46757] dataclasses should define an empty __post_init__

2022-02-18 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

I like this idea.

`attrs` right now behave the same way (no default `__attrs_post_init__`:

```
>>> import attrs
>>> @attrs.define
... class Some:
...   x: int
... 
>>> @attrs.define
... class Other(Some):
...def __attrs_post_init__(self):
...   super().__attrs_post_init__()
...   self.x += 1
... 
>>> Other(1)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in __init__
  File "", line 4, in __attrs_post_init__
AttributeError: 'super' object has no attribute '__attrs_post_init__'
```

I am attaching a simple patch.

Alternative solution is to not merge this patch and recommend this instead:

```
def __post_init__(self):
  try:
super().__post_init__()
  except AttributeError:
pass
```

--
nosy: +sobolevn

___
Python tracker 

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



[issue46795] Why Does 3rd/Python39/Lib/site-packages/psycopg2/_psycopg.cp39-win_amd64.pyd Have the CVE-20211-4160 Vulnerability? I Use Python 3.9.2? Where Is OpenSSL Used?

2022-02-18 Thread zjmxq


Change by zjmxq :


--
title: Why does 
3rd/Python39/Lib/site-packages/psycopg2/_psycopg.cp39-win_amd64.pyd have the 
CVE-201-4160 vulnerability when I use Python 3.9.2 -> Why Does 
3rd/Python39/Lib/site-packages/psycopg2/_psycopg.cp39-win_amd64.pyd Have the 
CVE-20211-4160 Vulnerability? I Use Python 3.9.2? Where Is OpenSSL Used?

___
Python tracker 

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



[issue46795] Why does 3rd/Python39/Lib/site-packages/psycopg2/_psycopg.cp39-win_amd64.pyd have the CVE-201-4160 vulnerability when I use Python 3.9.2

2022-02-18 Thread zjmxq


Change by zjmxq :


--
components: Library (Lib)
nosy: zjmxq
priority: normal
severity: normal
status: open
title: Why does 
3rd/Python39/Lib/site-packages/psycopg2/_psycopg.cp39-win_amd64.pyd have the 
CVE-201-4160 vulnerability when I use Python 3.9.2
type: security
versions: Python 3.9

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-18 Thread Meer Suri


Change by Meer Suri :


--
pull_requests: +29564
pull_request: https://github.com/python/cpython/pull/31429

___
Python tracker 

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



[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-18 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
pull_requests: +29563
pull_request: https://github.com/python/cpython/pull/31428

___
Python tracker 

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



[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-18 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks, I'll send a PR.

--

___
Python tracker 

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



[issue44791] Substitution of ParamSpec in Concatenate

2022-02-18 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

I'm looking at https://github.com/python/cpython/pull/30969 and I'm not sure 
what the motivation for the change is. PEP 612 is quite precise here 
(https://www.python.org/dev/peps/pep-0612/#id1) and allows only a ParamSpec as 
the last argument to Concatenate.

What is the use case for using ... as the last argument? What should it mean to 
a static type checker?

--

___
Python tracker 

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



[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-18 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
pull_requests: +29562
pull_request: https://github.com/python/cpython/pull/31427

___
Python tracker 

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



[issue46782] Docs error for 3.10

2022-02-18 Thread sjndlnv brjkbn


sjndlnv brjkbn  added the comment:

I found out that this issue can be fixed by set ``autodoc_preserve_defaults`` 
to True [(From 
sphinx-doc)](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_preserve_defaults)

On the other hand. I test ``Path.mkdir(mode=511)`` on my mac. It's the same as 
``Path.mkdir(mode=0o77)``

But it's not the same on my company's dev linux server.

I will double check this part on Monday.

--

___
Python tracker 

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



[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-18 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The test introduces a deprecation warning. It might be fixed by using raw 
string like the msg_format used in other test.


./python -Wall -m py_compile Lib/test/test_property.py
Lib/test/test_property.py:345: DeprecationWarning: invalid escape sequence '\.'
  msg_format = "^property of 'PropertyUnreachableAttributeNoName\.cls' object 
{}$"

--
nosy: +xtreak

___
Python tracker 

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



[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-18 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This change has introduced deprecation warning in tests

PYTHONWARNINGS=always ./python -Wall -X dev -m test.test_typing 
s./home/karthikeyan/stuff/python/cpython/Lib/test/test_typing.py:4589:
 DeprecationWarning: The kwargs-based syntax for TypedDict definitions is 
deprecated in Python 3.11, will be removed in Python 3.13, and may not be 
understood by third-party type checkers.
  TypedDict('Emp', _fields={'name': str, 'id': int})
./home/karthikeyan/stuff/python/cpython/Lib/test/test_typing.py:4602: 
DeprecationWarning: The kwargs-based syntax for TypedDict definitions is 
deprecated in Python 3.11, will be removed in Python 3.13, and may not be 
understood by third-party type checkers.
  TypedDict('Hi', x=1)

--
Ran 451 tests in 0.105s

OK (skipped=1)

--
nosy: +xtreak

___
Python tracker 

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



[issue46615] Use-after-free by mutating set during set operations

2022-02-18 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

It does look like there are some pickle situations that crash. Attached is a 
randomized crasher. I haven't done too much careful reasoning about it, but 
adding INCREFs everywhere seems to fix most of the issues.

--
Added file: https://bugs.python.org/file50631/picklecrasher.py

___
Python tracker 

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



[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-18 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue46400] Please update bundled libexpat to 2.4.4 with security fixes (CVE-2021-45960)

2022-02-18 Thread Ned Deily


Ned Deily  added the comment:

expat 2.4.5 was released today (Issue46794).

--
nosy: +ned.deily

___
Python tracker 

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



[issue46771] Add some form of cancel scopes

2022-02-18 Thread Tin Tvrtković

Change by Tin Tvrtković :


--
pull_requests: +29561
pull_request: https://github.com/python/cpython/pull/31415

___
Python tracker 

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



[issue24053] Define EXIT_SUCCESS and EXIT_FAILURE constants in sys

2022-02-18 Thread Golubev Alexander


Golubev Alexander  added the comment:

Any reasons the PR still not merged?

--
nosy: +Fat-Zer

___
Python tracker 

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



[issue46754] Improve Python Language Reference based on [Köhl 2020]

2022-02-18 Thread Alex Waygood


Change by Alex Waygood :


--
keywords:  -patch
nosy:  -AlexWaygood
stage: patch review -> 

___
Python tracker 

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



[issue46754] Improve Python Language Reference based on [Köhl 2020]

2022-02-18 Thread Alex Waygood


Change by Alex Waygood :


--
pull_requests:  -29560

___
Python tracker 

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



[issue46754] Improve Python Language Reference based on [Köhl 2020]

2022-02-18 Thread Alex Waygood


Change by Alex Waygood :


--
keywords: +patch
nosy: +AlexWaygood
nosy_count: 1.0 -> 2.0
pull_requests: +29560
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29479

___
Python tracker 

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



[issue46603] `typing._strip_annotations` is not fully covered

2022-02-18 Thread miss-islington


miss-islington  added the comment:


New changeset 103f3ca80616958b4e608e9176b9c12cfc80f68b by Miss Islington (bot) 
in branch '3.10':
bpo-46603: improve coverage of `typing._strip_annotations` (GH-31063)
https://github.com/python/cpython/commit/103f3ca80616958b4e608e9176b9c12cfc80f68b


--

___
Python tracker 

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



[issue46685] Add additional tests for new features in `typing.py`

2022-02-18 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue46685] Add additional tests for new features in `typing.py`

2022-02-18 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 32e3e0bea613711a8f19003445eebcb05fb75acc by Nikita Sobolev in 
branch 'main':
bpo-46685: improve test coverage of `Self` and `Never` in `typing` (GH-31222)
https://github.com/python/cpython/commit/32e3e0bea613711a8f19003445eebcb05fb75acc


--

___
Python tracker 

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



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-02-18 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks for the fix Nikita!

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

___
Python tracker 

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



[issue46603] `typing._strip_annotations` is not fully covered

2022-02-18 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue46603] `typing._strip_annotations` is not fully covered

2022-02-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29559
pull_request: https://github.com/python/cpython/pull/31424

___
Python tracker 

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



[issue46603] `typing._strip_annotations` is not fully covered

2022-02-18 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46603] `typing._strip_annotations` is not fully covered

2022-02-18 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 25c0b9d243b64ccd2eeab483089eaf7e4b4d5834 by Nikita Sobolev in 
branch 'main':
bpo-46603: improve coverage of `typing._strip_annotations` (GH-31063)
https://github.com/python/cpython/commit/25c0b9d243b64ccd2eeab483089eaf7e4b4d5834


--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-02-18 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 395029b0bd343648b4da8044c7509672ea768775 by Nikita Sobolev in 
branch 'main':
bpo-46571: improve `typing.no_type_check` to skip foreign objects (GH-31042)
https://github.com/python/cpython/commit/395029b0bd343648b4da8044c7509672ea768775


--

___
Python tracker 

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



[issue46793] expose expat XML billion laughs attack mitigation APIs

2022-02-18 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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

err "release managers" same thing right? ;)

--

___
Python tracker 

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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

PRs for 3.7 and 3.8 remain up to release blockers.

--
components: +Build
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset e05e3d20d309603010f2c1194e612f894ad8a985 by Gregory P. Smith in 
branch '3.10':
[3.10] bpo-46784: Add newly exported expat symbols to the namespace. (GH-31397) 
(GH-31420)
https://github.com/python/cpython/commit/e05e3d20d309603010f2c1194e612f894ad8a985


--

___
Python tracker 

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



[issue46200] Discourage logging f-strings due to security considerations

2022-02-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

A new system of logging APIs has been on several of our (core dev and 
otherwise) minds ever since f-strings were introduced.  For this specific 
issue, agreed that documentation is key.

The old logging APIs cannot change.  And practically preventing passing 
non-literal constant values in as the first parameter within their 
implementation while there are theoretical ways to _maybe_ do that, I expect 
none would be maintainable or performant.

For https://www.python.org/dev/peps/pep-0675/#logging-format-string-injection, 
my gut feeling is you want logging functions annotated as is a duality using 
overload.

```
@overload
def info(str) -> None:
...

@overload
def info(msg: LiteralString, *args: object) -> None:
```

As that prevents the untrusted template in msg so you could use a lone f-str.

This larger conversation is better turned into a python-dev or 
discuss.python.org thread than done in our poor bug tracker as anything more 
than the doc update and musing around the annotations turns into an evolved 
logging system design discussion.  (a nice thread internally at work just 
restarted about this and linked here... people want f-logging!)

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



[issue46782] Docs error for 3.10

2022-02-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The conversions from 0o777 to 511 in 3.10 and 3.11 but not in 3.9 are these:

https://docs.python.org/3/library/pathlib.html#pathlib.Path.mkdir
  Path.mkdir(mode=511, parents=False, exist_ok=False)

https://docs.python.org/3/library/os.html#os.mkdir
  os.mkdir(path, mode=511, *, dir_fd=None)

I don't know whether different sphinx versions are used for different versions 
of the docs.

--
nosy: +eric.araujo, mdk, terry.reedy

___
Python tracker 

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



[issue46794] Please update bundled libexpat to 2.4.5 with security fixes (5 CVEs)

2022-02-18 Thread sping


New submission from sping :

Thank you!

https://github.com/libexpat/libexpat/blob/97a4840578693a346e79302909b67d97492e1880/expat/Changes#L6-L35

--
components: XML
messages: 413517
nosy: sping
priority: normal
severity: normal
status: open
title: Please update bundled libexpat to 2.4.5 with security fixes (5 CVEs)
type: security
versions: Python 3.10, Python 3.11, 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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +29557
pull_request: https://github.com/python/cpython/pull/31420

___
Python tracker 

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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread miss-islington


miss-islington  added the comment:


New changeset 9aca412db8343702d9199c31ba73519e6f8823b5 by Miss Islington (bot) 
in branch '3.9':
bpo-46784: Add newly exported expat symbols to the namespace. (GH-31397)
https://github.com/python/cpython/commit/9aca412db8343702d9199c31ba73519e6f8823b5


--

___
Python tracker 

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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29556
pull_request: https://github.com/python/cpython/pull/31419

___
Python tracker 

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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29555
pull_request: https://github.com/python/cpython/pull/31418

___
Python tracker 

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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29554
pull_request: https://github.com/python/cpython/pull/31417

___
Python tracker 

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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29553
pull_request: https://github.com/python/cpython/pull/31416

___
Python tracker 

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



[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-18 Thread miss-islington


miss-islington  added the comment:


New changeset 6312c1052c0186b4596fc45c42fd3ade9f8f5911 by Yilei "Dolee" Yang in 
branch 'main':
bpo-46784: Add newly exported expat symbols to the namespace. (GH-31397)
https://github.com/python/cpython/commit/6312c1052c0186b4596fc45c42fd3ade9f8f5911


--
nosy: +miss-islington

___
Python tracker 

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



[issue46760] test_dis should test the dis module, not everything else

2022-02-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

With IDLE, I have issues with trying to test IDLE code without retesting 
tkinter, as well as deciding on the proper units of behavior to test.

Some suggestions: 
1. Add a docstring to the module with guidelines, after review from a couple of 
others.
For instance,I believe you are saying that no test should explicitly call 
compile.  Rather the test writer should call compile and extract the bytecode 
to copy into a test.

2. Make yourself a module code owner so you get informed and can review.  
Reviewing would be easier with guidelines to refer to, instead of repeating 
them.

3. An example issue is that some callables take many types of arguments.  If 
not already, tests that the function can extract the bytecode from various 
objects should be separate from tests that extracted bytecode is then handled 
properly.  Would any internal refactoring of dis and addition of _test 
functions make it easier to make test more independent of each other?

4. I would rather read the multiple long lists like

expected_opinfo_outer = [
  Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=3, argrepr='3', 
offset=0, starts_line=2, is_jump_target=False),
  Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', 
offset=3, starts_line=None, is_jump_target=False),
  ...
]

condensed to

expected_opinfo_outer = [Instruction(opname, opcode, arg, argval, argrepr,
 offset, starts_line, is_jumps_target)
for opname, opcode, arg, argval, argrepr, offset, starts_line, 
is_jumps_target in
(('LOAD_CONST', 100,1,   3, '3',  0,  2,   False),
 ('LOAD_CONST', 100,2,   4, '4',  3,  None,False),
 ...
)]

--
nosy: +terry.reedy

___
Python tracker 

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



[issue46793] expose expat XML billion laughs attack mitigation APIs

2022-02-18 Thread Gregory P. Smith


New submission from Gregory P. Smith :

Quoting from 
https://github.com/python/cpython/pull/31397#issuecomment-1044796561

"""
XML_SetBillionLaughsAttackProtectionActivationThreshold

XML_SetBillionLaughsAttackProtectionMaximumAmplification

I still hope that someone can make those two^^ accessible (with additional glue 
code) to the user on pyexpat level in CPython.
""" - Sebastian Pipping @hartwork

--
messages: 413513
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: expose expat XML billion laughs attack mitigation APIs
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



[issue46702] Specialize UNPACK_SEQUENCE

2022-02-18 Thread Brandt Bucher


Brandt Bucher  added the comment:

Closing as UNPACK_SEQUENCE_TWO_TUPLE__STORE_FAST__STORE_FAST results in lots of 
hits, but no performance improvement.

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



[issue33601] [doc] Py_UTF8Mode is not documented

2022-02-18 Thread Vidhya


Vidhya  added the comment:

[Entry level contributor seeking guidance]The PR on this issue looks closed. I 
worked on this and attaching the updated html file.

I will open a pull request if this is not yet resolved.

--
nosy: +vidhya.friend
Added file: https://bugs.python.org/file50630/init.html

___
Python tracker 

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



[issue35897] Support list as argument to .startswith()

2022-02-18 Thread Fred


Fred  added the comment:

> For subtle reasons, that would make us worse off.  Tuple of constants get 
> precomputed but lists of constants have to be rebuilt.

So if a list is 20 times slower than a tuple, I can still do billions of 
computations in a second on a Raspberry Pi, so does it matter?

Being able to pass a list into .startswith() makes it more user-friendly and 
makes Python be more productive for the developer.

--

___
Python tracker 

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



[issue46740] Improve Telnetlib's throughput

2022-02-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Even if deprecated, it will be around for at least 2 versions.  A patch now 
might be worthwhile, but I don't know who would review it.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue46735] gettext.translations crashes when locale is unset

2022-02-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

As 'crash', as used here, is when python exits abnormally *without* an 
exception traceback.  The traceback in the linked report is:

Traceback (most recent call last):
  File "video2x.py", line 53, in 
from upscaler import AVAILABLE_DRIVERS
  File "/home/meltonmb/video2x-4.6.1/src/upscaler.py", line 48, in 
language = gettext.translation(DOMAIN, LOCALE_DIRECTORY, [default_locale], 
fallback=True)
  File "/usr/lib/python3.8/gettext.py", line 583, in translation
mofiles = find(domain, localedir, languages, all=True)
  File "/usr/lib/python3.8/gettext.py", line 554, in find
for nelang in _expand_lang(lang):
  File "/usr/lib/python3.8/gettext.py", line 213, in _expand_lang
loc = locale.normalize(loc)
  File "/usr/lib/python3.8/locale.py", line 401, in normalize
code = localename.lower()
AttributeError: 'NoneType' object has no attribute 'lower'

Whether the bug is in the 3rd party module 'upscaler' or the stdlib module 
gettext depends on whether the DOMAIN, LOCALE_DIRECTORY, and [default_locale] 
arguments in upscaler's call to gettext.translation meet the documented 
requirements.  What are their values?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue46725] Unpacking without parentheses is allowed since 3.9

2022-02-18 Thread Guido van Rossum


Guido van Rossum  added the comment:

Adding jwilk back (a bpo interaction with browser form caching makes this 
happen frequently).

--
nosy: +jwilk

___
Python tracker 

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



[issue46733] pathlib.Path methods can raise NotImplementedError

2022-02-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I think pathlib should be raising TypeError, ValueError, or something else as 
appropriate.  Or not raising in situations Eryk indicated.  x/0 *could* be +- 
float('inf'), but we don't raise NotImplementedError for it.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue46732] None.__bool__ docstring is wrong

2022-02-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

There is no object.__bool__.  None.__bool__.__doc__ appears to be an accidental 
copy of bool/int/float/complex.__bool__.__doc__.  It should just be 'False'.

--
nosy: +terry.reedy
title: object.__bool__ docstring is wrong -> None.__bool__ docstring is wrong

___
Python tracker 

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



[issue46391] Library multiprocess leaks named resources.

2022-02-18 Thread Andrzej Ratajczak


Andrzej Ratajczak  added the comment:

Also hitting this problem. Would be grateful for fixing it, since there is 
already PR created

--
nosy: +BarkingBad

___
Python tracker 

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



[issue20923] [doc] Explain ConfigParser 'valid section name' and .SECTCRE

2022-02-18 Thread Vidhya


Change by Vidhya :


--
pull_requests: +29552
pull_request: https://github.com/python/cpython/pull/31413

___
Python tracker 

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



[issue34990] year 2038 problem in compileall.py

2022-02-18 Thread Jakub Wilk


Change by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue35897] Support list as argument to .startswith()

2022-02-18 Thread Jakub Wilk


Change by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue46792] Indentation not preserved with ruamel.yaml.round_trip_dump

2022-02-18 Thread Eric V. Smith


Change by Eric V. Smith :


--
title: Indentation now preserved with ruamel.yaml.round_trip_dump -> 
Indentation not preserved with ruamel.yaml.round_trip_dump

___
Python tracker 

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



[issue46792] Indentation now preserved with ruamel.yaml.round_trip_dump

2022-02-18 Thread Zachary Ware


Change by Zachary Ware :


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



[issue46792] Indentation now preserved with ruamel.yaml.round_trip_dump

2022-02-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

This looks like an issue with ruamel.yaml, which is a third party package. You 
should report it to them.

Good luck!

--
nosy: +eric.smith

___
Python tracker 

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



[issue46792] Indentation now preserved with ruamel.yaml.round_trip_dump

2022-02-18 Thread Harshini


New submission from Harshini :

I observed that the indentation is not preserved when I load and dump a YAML 
file using round_trip_dump from ruamel.yaml. For example, I have an input file 
with the data:

Inventory:
  - name: Apples
count: 10
vendors:
- - vendor_name: xyz
boxes: 2

  - name: Bananas
number: 20
vendors:
- - vendor_name: abc
boxes: 1
  - vendor_name: xyz
boxes: 4


I wrote a simple script that just loads and dumps the same data into a new YAML 
file:

import sys
import os
import ruamel.yaml

yaml = ruamel.yaml.YAML()
input_file = sys.argv[1]
output_yaml =  r"data_output.yaml"
output = open(output_yaml, 'w+')
with open(input_file, 'r') as f:
data = yaml.load(f)
ruamel.yaml.round_trip_dump(data, output)


I would expect the output yaml to be the same as the input yaml but what is see 
is:

Inventory:
- name: Apples
  count: 10
  vendors:
  - - vendor_name: xyz
  boxes: 2
- name: Bananas
  number: 20
  vendors:
  - - vendor_name: abc
  boxes: 1
- vendor_name: xyz
  boxes: 4

It is missing the indentation under Inventory as there should be a tab before 
"- name" .

--
components: Library (Lib)
files: input.yaml
messages: 413502
nosy: nvorugan
priority: normal
severity: normal
status: open
title: Indentation now preserved with ruamel.yaml.round_trip_dump
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50629/input.yaml

___
Python tracker 

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



[issue46725] Unpacking without parentheses is allowed since 3.9

2022-02-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Allowing no parentheses is also consistent with the following:
  for x in 1,2,3: print(x)

--
nosy: +terry.reedy -jwilk

___
Python tracker 

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



[issue46748] Python.h includes stdbool.h

2022-02-18 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue46725] Unpacking without parentheses is allowed since 3.9

2022-02-18 Thread Jakub Wilk


Change by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

2022-02-18 Thread Éric Araujo

Éric Araujo  added the comment:

Would you like to make a pull request?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue46791] Allow os.remove to defer to rmdir

2022-02-18 Thread Dan Snider

New submission from Dan Snider :

It appears sometime recently-ish that POSIX updated remove to the following:

#include 
int remove(const char *path);

If path does not name a directory, remove(path) shall be equivalent to 
unlink(path). If path names a directory, remove(path) shall be equivalent to 
rmdir(path).

--
messages: 413499
nosy: bup
priority: normal
severity: normal
status: open
title: Allow os.remove to defer to rmdir
type: enhancement

___
Python tracker 

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



[issue46789] Restore caching of externals on Windows buildbots

2022-02-18 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

I personally would like to see caching restored so as to keep the duration of 
buildbot runs as low as possible.  The repeated fetching effectively doubles 
compilation time for my Win11 builder.

--

___
Python tracker 

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



[issue46790] Normalize handling of negative timeouts in subprocess.py

2022-02-18 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Oh, I forgot to add that I'm in favor of following the threading.py behavior of 
allowing <=0 to mean "non-blocking" (i.e., just check).  This would probably 
also benefit from a documentation update to clarify.

--

___
Python tracker 

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



[issue46790] Normalize handling of negative timeouts in subprocess.py

2022-02-18 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +eryksun, vstinner

___
Python tracker 

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



[issue46790] Normalize handling of negative timeouts in subprocess.py

2022-02-18 Thread Jeremy Kloth


New submission from Jeremy Kloth :

As a follow on to bpo-46716, the various timeout parameters currently deal with 
negative values differently in POSIX and Windows.

On POSIX, a negative value is treated the same as 0; check completion and raise 
TimeoutExpired is still running.

On Windows, the negative value is treated as unsigned and ultimately waits for 
~49 days.

While the Windows behavior is obviously wrong and will be fixed internally as 
part of bpo-46716, that still leaves what to do with timeouts coming from 
user-space.  The current documentation just states that after `timeout` seconds 
TimeoutExpired is raised.  A liberal reading of the documentation could lead 
one to believe any value <=0 would suffice for an "active" check (the POSIX 
behavior).

OR, the documentation could be amended and negative values are now invalid and 
apply range checking in the user-facing functions.

--
components: Library (Lib)
messages: 413496
nosy: jkloth
priority: normal
severity: normal
status: open
title: Normalize handling of negative timeouts in subprocess.py
versions: Python 3.10, Python 3.11, 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



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-02-18 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset cf345e945f48f54785799390c2e92c5310847bd4 by Mark Shannon in 
branch 'main':
bpo-46329: Change calling sequence (again) (GH-31373)
https://github.com/python/cpython/commit/cf345e945f48f54785799390c2e92c5310847bd4


--

___
Python tracker 

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



[issue46752] Introduce task groups to asyncio and change task cancellation semantics

2022-02-18 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +29551
pull_request: https://github.com/python/cpython/pull/31411

___
Python tracker 

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



[issue46789] Restore caching of externals on Windows buildbots

2022-02-18 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +pablogsal, vstinner

___
Python tracker 

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



[issue46789] Restore caching of externals on Windows buildbots

2022-02-18 Thread Jeremy Kloth


New submission from Jeremy Kloth :

A recent change to the buildmaster config effectively disabled the caching of 
the externals for Windows buildbots:
   https://github.com/python/buildmaster-config/pull/255

If the caching is desired, a simple change to the buildmaster config is needed 
(define EXTERNALS_DIR in the build environment).  Or, to continue with fetching 
them each run, the buildbot scripts in Tools\buildbot can be simplified.

Once a course of action is determined I can develop the requisite PR(s) in the 
appropriate tracker.

--
components: Build, Tests, Windows
messages: 413494
nosy: jkloth, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Restore caching of externals on Windows buildbots

___
Python tracker 

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



[issue46788] regrtest fails to start on missing performance counter names

2022-02-18 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +vstinner

___
Python tracker 

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



[issue46788] regrtest fails to start on missing performance counter names

2022-02-18 Thread Jeremy Kloth


New submission from Jeremy Kloth :

When attempting to run the test harness, I receive the following:

Traceback (most recent call last):
  File "", line 198, in _run_module_as_main
  File "", line 88, in _run_code
  File "C:\Public\Devel\cpython\main\Lib\test\__main__.py", line 2, in 
main()
^^
  File "C:\Public\Devel\cpython\main\Lib\test\libregrtest\main.py", line 736, 
in main
Regrtest().main(tests=tests, **kwargs)
^^
  File "C:\Public\Devel\cpython\main\Lib\contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
^
  File "C:\Public\Devel\cpython\main\Lib\contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
^
  File "C:\Public\Devel\cpython\main\Lib\test\support\os_helper.py", line 396, 
in temp_dir
yield path
^^
  File "C:\Public\Devel\cpython\main\Lib\contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
^
  File "C:\Public\Devel\cpython\main\Lib\test\support\os_helper.py", line 427, 
in change_cwd
yield os.getcwd()
^
  File "C:\Public\Devel\cpython\main\Lib\test\support\os_helper.py", line 449, 
in temp_cwd
yield cwd_dir
^
  File "C:\Public\Devel\cpython\main\Lib\test\libregrtest\main.py", line 658, 
in main
self._main(tests, kwargs)
^
  File "C:\Public\Devel\cpython\main\Lib\test\libregrtest\main.py", line 704, 
in _main
self.win_load_tracker = WindowsLoadTracker()

  File "C:\Public\Devel\cpython\main\Lib\test\libregrtest\win_utils.py", line 
41, in __init__
self.start()

  File "C:\Public\Devel\cpython\main\Lib\test\libregrtest\win_utils.py", line 
70, in start
counter_name = self._get_counter_name()
   
  File "C:\Public\Devel\cpython\main\Lib\test\libregrtest\win_utils.py", line 
90, in _get_counter_name
system = counters_dict['2']
 ~^
KeyError: '2'

This is due to my machine missing the localized names for the performance 
counters.  Other performance monitoring tools operate just fine.

While I have been working around this issue for some time, it has become 
difficult to seperate the workarounds from actually changes in the test harness.

The PR (https://github.com/python/cpython/pull/26578) from 
https://bugs.python.org/issue44336 also solves this issue by accessing the 
counters directly instead of relying on their localized names.

--
components: Tests, Windows
messages: 413493
nosy: jkloth, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: regrtest fails to start on missing performance counter names
versions: Python 3.10, Python 3.11, 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



[issue46780] Allow Fractions to return 1/6 for "0.17", "0.167", "0.1667", etc.

2022-02-18 Thread Lee Newberg


Lee Newberg  added the comment:

I have started a discussion at 
https://discuss.python.org/t/allow-fractions-fraction-to-return-1-6-for-0-17-0-167-0-1667-etc
 .  Your feedback there would be much appreciated.

--

___
Python tracker 

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



[issue46752] Introduce task groups to asyncio and change task cancellation semantics

2022-02-18 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +29550
pull_request: https://github.com/python/cpython/pull/31409

___
Python tracker 

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



[issue46771] Add some form of cancel scopes

2022-02-18 Thread Yury Selivanov


Yury Selivanov  added the comment:

> * `async with` vs `with`: if Andrew thinks `async with` is easier to teach 
> and less error-prone,

It has to be 'async with' like most asyncio apis to avoid user confusion.

--

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-02-18 Thread Larry Hastings


Larry Hastings  added the comment:

Just checking--I can liberally pull code from 
https://github.com/BLAKE3-team/BLAKE3 yes?

--

___
Python tracker 

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



[issue46771] Add some form of cancel scopes

2022-02-18 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

> the third case the behavior is wrong, the `.cancel()` should win over the 
> timeout. Otherwise using the context manager becomes too risky in real-world 
> situations.

Please elaborate. The first code that calls `.cancel()` wins, doesn't matter 
what is the source. asyncio has no priorities.

> I also think your first graph has an issue if the user has a `try/except 
> TimeoutError` between `timeout-a` and `timeout-b`, which is now more probable 
> since we're dropping `move_on`. We can take the discussion to the forked 
> repo; I can put together some tests if that would make it easier.

Ok, let's discuss on GitHub. I only would mention that no code could be 
executed between timeout-a and timeout-b, because both events are scheduled 
between the previous event loop iteration and the current one.
Sure, if we can start talking with code (and failed tests) -- it can raise the 
understanding level very much.

--

___
Python tracker 

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



[issue46780] Allow Fractions to return 1/6 for "0.17", "0.167", "0.1667", etc.

2022-02-18 Thread Mark Dickinson


Mark Dickinson  added the comment:

> I gave the code example in order to make that clear.

Yep, that didn't help: reverse engineering the intended behaviour from a 
complicated piece of code isn't easy. An up-front description of the intended 
behaviour would be better.

--

___
Python tracker 

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



[issue46780] Allow Fractions to return 1/6 for "0.17", "0.167", "0.1667", etc.

2022-02-18 Thread Mark Dickinson


Mark Dickinson  added the comment:

Re python-ideas: there's a mailing list: 

https://mail.python.org/archives/list/python-id...@python.org/

But the https://discuss.python.org/c/ideas/ category also works for this.

--

___
Python tracker 

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



[issue46787] ProcessPoolExecutor exception memory leak

2022-02-18 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +29548
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31408

___
Python tracker 

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



[issue45559] pprint tests do not test pprint.pprint()

2022-02-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

Sure, have a go at it!

Any testing of pprint.pprint() would be an improvement, but ideally all options 
should be tested.

It would probably be worthwhile to restructure the tests to run both pformat 
and pprint tests from the same logic, so that we only need to change one thing 
if new options are added. I haven't looked at the tests, so I'm not sure how 
much work this would be.

--

___
Python tracker 

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



[issue46787] ProcessPoolExecutor exception memory leak

2022-02-18 Thread Vladimir Vinogradenko


New submission from Vladimir Vinogradenko :

If an exception occurs in ProcessPoolExecutor work item, all the exception 
frame local variables are not garbage collected (or are garbage collected too 
lately) because they are referenced by the exception's traceback.

Attached file is a test case. With unpatched python 3.9 (debian bullseye) it 
prints:

root@truenas[~/freenas/freenas]# python test.py
At iteration 0 memory usage is 226070528
At iteration 1 memory usage is 318763008
At iteration 2 memory usage is 318509056
At iteration 3 memory usage is 321662976
At iteration 4 memory usage is 321404928
At iteration 5 memory usage is 324292608
At iteration 6 memory usage is 324296704
At iteration 7 memory usage is 326922240
At iteration 8 memory usage is 326922240
At iteration 9 memory usage is 329543680

With the proposed patch there is no memory usage growth:

At iteration 0 memory usage is 226410496
At iteration 1 memory usage is 226451456
At iteration 2 memory usage is 226451456
At iteration 3 memory usage is 226443264
At iteration 4 memory usage is 226443264
At iteration 5 memory usage is 226435072
At iteration 6 memory usage is 226426880
At iteration 7 memory usage is 226426880
At iteration 8 memory usage is 226435072
At iteration 9 memory usage is 226426880

--
components: Library (Lib)
files: 1.py
messages: 413485
nosy: themylogin
priority: normal
severity: normal
status: open
title: ProcessPoolExecutor exception memory leak
type: resource usage
versions: Python 3.9
Added file: https://bugs.python.org/file50628/1.py

___
Python tracker 

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



[issue45559] pprint tests do not test pprint.pprint()

2022-02-18 Thread Haz


Haz  added the comment:

Hi! Any chance I could take this on if it hasn't already been actioned please? 
I assume the scope is to test all the pprint options?

Thanks!

--
nosy: +hp310780

___
Python tracker 

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



[issue46780] Allow Fractions to return 1/6 for "0.17", "0.167", "0.1667", etc.

2022-02-18 Thread Lee Newberg


Lee Newberg  added the comment:

In case there are others who are unsure about "python-ideas" ... I believe the 
discussion page https://discuss.python.org/c/ideas is what was meant.

--

___
Python tracker 

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



[issue46780] Allow Fractions to return 1/6 for "0.17", "0.167", "0.1667", etc.

2022-02-18 Thread Lee Newberg


Lee Newberg  added the comment:

> Please watch the tone. It is borderline abusive and dismissive.

I apologize for the adverse impact there.  I will be more careful.

> Also, my expectation for Fraction("0.0015") would be to give Fraction(3, 
> 2000), the same as would be given by Fraction(Decimal("0.0015")).

Yes, 0.0015 would be 3/2000.  However, in my example "0.0015" is the right 
endpoint of [0.0005, 0.0015), not the value "0.001" that we are seeking the 
fraction for.

> Perhaps this tracker issue should be closed and moved to python-ideas.  The 
> notions are currently too immature to warrant more core developer time.

You have more experience with this than I.  I defer to you.

> Agreed. It seems that what Lee wants is some kind of blend between the 
> simplest fraction and the closest fraction, and it's not clear exactly how 
> that blend would work.

Drat.  I gave the code example in order to make that clear.  I guess we can 
continue to discuss this at "python-ideas".  My quick web search for that turns 
up a lot of things.  If you could give me a lead -- is there a web URL for 
that, is it an e-mail list, etc.?

Thank you all for your valuable comments.

--

___
Python tracker 

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



[issue46771] Add some form of cancel scopes

2022-02-18 Thread Alex Grönholm

Alex Grönholm  added the comment:

I propose the following, backwards compatible solution:

Add a new keyword argument to Task.cancel(): "scope: object = None".
The behavior would be as follows: the scope is saved, and included in the 
raised CancelledError. If Task.cancel() is called again, but with scope=None 
(the default), it clears out the saved scope, if any. Any other scope will be 
ignored.

This simple change would allow for proper implementation of any context manager 
that needs to swallow or transform a CancelledError raised in the task.

--

___
Python tracker 

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



[issue46771] Add some form of cancel scopes

2022-02-18 Thread Tin Tvrtković

Tin Tvrtković  added the comment:

Sure, I'll be glad to work with Andrew on getting something presentable.

Going through the discussion in the issue:

* it seems like folks don't think move_on is useful enough to be in the stdlib, 
I understand that point. Users can always catch the timeout error from 
`timeout`, and I can just keep `move_on` in Quattro. We can always add it 
later. So as far as I'm concerned we can drop it.
* `async with` vs `with`: if Andrew thinks `async with` is easier to teach and 
less error-prone, I'm ok with having the `async with` civilian version in the 
stdlib and I can keep the `with` expert versions in Quattro, no problem there.

So I'm most interested in the cancellation semantics, because those will be 
very hard to fix in a 3rd party package.

@Andrew, in your schema for the third case the behavior is wrong, the 
`.cancel()` should win over the timeout. Otherwise using the context manager 
becomes too risky in real-world situations. I also think your first graph has 
an issue if the user has a `try/except TimeoutError` between `timeout-a` and 
`timeout-b`, which is now more probable since we're dropping `move_on`. We can 
take the discussion to the forked repo; I can put together some tests if that 
would make it easier.

--

___
Python tracker 

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



[issue46709] test_urllib: testInterruptCaught() has a race condition and fails randomly

2022-02-18 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset e2c28616ce6c3cdb1013c415125220a0b86b86a1 by Nikita Sobolev in 
branch 'main':
bpo-46709: check eval breaker in specialized `CALL` opcodes (GH-31404)
https://github.com/python/cpython/commit/e2c28616ce6c3cdb1013c415125220a0b86b86a1


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue46771] Add some form of cancel scopes

2022-02-18 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Guido, the third case:

The third edge case is: explicit cancel() happened *after* the timeout (but 
still in the
same iteration)?

   timeout  current-iteration (calls .cancel() after timeout)  next-iteration
 || |
 >---++-+-->
 > future

  a) timeout occurs, `call_later()`' callback is called, the task cancellation 
is scheduled 
  on the next loop iteration by `task.cancel()` call
  b) other activity (e.g. socket-ready event that processed after timers in 
asyncio)
  explicitly calls `.cancel()`. The second request is ignored, `.cancel()` 
returns `False`.
  c) On the next iteration, the task wakes up with CancelledError with a 
message that points
  on the timeout context manager. 

It means that the timeout is processed, explicit `.cancel()` call that happens 
*after*
timeout is ignored. The first event wins, as usual.

--

___
Python tracker 

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



[issue46786] embed, source, track, wbr HTML elements not considered empty

2022-02-18 Thread jnns


Change by jnns :


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

___
Python tracker 

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



[issue45184] Add `pop` function to remove context manager from (Async)ExitStack

2022-02-18 Thread Václav Brožík

Václav Brožík  added the comment:

There was an interesting discussion about this problem in 2015-12:
https://mail.python.org/archives/list/python-id...@python.org/thread/Y3SLBJHJHAMBEZJWRXEJ5LE5JBVNE7XS/
(https://groups.google.com/g/python-ideas/c/l2FcErYbjfo - for the case the link 
above rots)

Certainly there are use cases for this functionality when you need to 
dynamically open multiple resources and close them when they are not needed any 
more. Keeping resources open till the very end of ExitStack is a bad practice 
which can lead to locking problems or overuse of resources.

--

___
Python tracker 

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



  1   2   >