[issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file

2022-02-18 Thread Antony Lee


New submission from Antony Lee :

In a first Python process, repeatedly create and delete a file:

from pathlib import Path
while True:
Path("foo").touch(); Path("foo").unlink()

In another process, repeatedly check for the path's existence:

from pathlib import Path
while True: print(Path("foo").exists())

On Linux, the second process prints a random series of True and False.  On 
Windows, it quickly fails after a few dozen iterations (likely 
machine-dependent) with

PermissionError: [WinError 5] Access is denied: 'foo'

which is actually raised by the stat() call.

I would suggest that this is not really desirable behavior?

--
components: Windows
messages: 413468
nosy: Antony.Lee, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: On Windows, os.stat() can fail if called while another process is 
creating or deleting the file
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



[issue46777] Fix incorrect use of directives in asyncio documentation

2022-02-18 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46777] Fix incorrect use of directives in asyncio documentation

2022-02-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2923d87ca258b9d421e8147b12f0d98295ee3f8e by Serhiy Storchaka in 
branch 'main':
bpo-46777: Fix incorrect use of directives in asyncio documentation (GH-31388)
https://github.com/python/cpython/commit/2923d87ca258b9d421e8147b12f0d98295ee3f8e


--

___
Python tracker 

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



[issue46777] Fix incorrect use of directives in asyncio documentation

2022-02-18 Thread miss-islington


miss-islington  added the comment:


New changeset 6eb34772fda2e46ba9a265e038b6e0f303bd790e by Miss Islington (bot) 
in branch '3.10':
bpo-46777: Fix incorrect use of directives in asyncio documentation (GH-31388)
https://github.com/python/cpython/commit/6eb34772fda2e46ba9a265e038b6e0f303bd790e


--

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

Okay, let's close here; as Raymond says, that doesn't prevent further 
discussion on python-ideas.

> The notions are currently too immature to warrant more core developer time.

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.

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



[issue46724] Odd Bytecode Generation in 3.10

2022-02-18 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset c3ce7781e3afe6f2dec5eef8e87fd5a664519ae9 by Saul Shanabrook in 
branch 'main':
bpo-46724: Fix dis support for overflow args (GH-31285)
https://github.com/python/cpython/commit/c3ce7781e3afe6f2dec5eef8e87fd5a664519ae9


--

___
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


New submission from jnns :

[According to the WHATWG][1], the elements `area`, `base`, `br`, `col`, 
`embed`, `hr`, `img`, `input`, `link`, `meta`, `param`, `source`, `track`, 
`wbr` are *void elements* that don't need and therefore shouldn't have a 
closing tag.

The source view of Firefox 96 shows a warning about an unexpected closing tag 
[1].

In Python 3.10.2 `xml.etree` seems to correctly recognize most of them as such 
and doesn't generate closing tags when using the `.tostring()` method. A few 
elements are serialized with a closing tag (`` for example). 

```python
from xml.etree import ElementTree as etree

void_elements = [
"area", "base","br", "col", "embed", "hr", "img", 
"input", "link", "meta", "param", "source", "track", "wbr"
]
for el in void_elements:
el = etree.Element(el)
print(etree.tostring(el, method="html", encoding="unicode"))
```

```html














```

HTML_EMPTY in Lib/xml/etree/ElementTree.py only contains the following entries:

"area", "base", "basefont", "br", "col", "frame", "hr", "img", "input", 
"isindex", "link", "meta", "param"

I suppose "embed", "source", "track" and "wbr" should be added to that list.  

  [1]: https://html.spec.whatwg.org/multipage/syntax.html#void-elements
  [2]: https://i.stack.imgur.com/rBTHw.png

--
components: XML
messages: 413473
nosy: jnns
priority: normal
severity: normal
status: open
title: embed, source, track, wbr HTML elements not considered empty
type: enhancement
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



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

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

Change by Václav Brožík :


--
nosy: +vbrozik

___
Python tracker 

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



[issue46777] Fix incorrect use of directives in asyncio documentation

2022-02-18 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

> 6. The loop parameter of Task() was documented as both removed and required 
> (if there is no current event loop) in 3.10.

I think we should drop Task() constructor definition from Task Object docs 
https://docs.python.org/3/library/asyncio-task.html#task-object but create 
'asyncio-extending.rst' (suggest better name please) with low-level task 
documentation for guys who want to create their own task class.

Task constructor could be documented here along with `_register_task()`, 
`_enter_task()`, `_leave_task()`, `_unregister_task()`. They might be useful 
for ones who implements a custom task factories.

--

___
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 am also uncomfortable using the cancel message to deliver the 
token/nonce/whatever.

If TaskGroup.cancel() is implemented, would it also deliver a cancellation in 
the parent task like trio and AnyIO do? It should IMHO, because otherwise if 
the task group is cancelled, it could still get stuck waiting on whatever the 
parent task happens to be waiting on, if it's not at TaskGroup.__aexit__() yet.

--

___
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 Nikita Sobolev


Change by Nikita Sobolev :


--
pull_requests: +29544
pull_request: https://github.com/python/cpython/pull/31404

___
Python tracker 

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



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls (test_urllib fails when run multiple times)

2022-02-18 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
nosy: +sobolevn
nosy_count: 7.0 -> 8.0
pull_requests: +29545
status: open -> pending
pull_request: https://github.com/python/cpython/pull/31404

___
Python tracker 

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



[issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file

2022-02-18 Thread Eryk Sun


Eryk Sun  added the comment:

Windows filesystems disallow new opens for a file that has its delete 
disposition set (i.e. the file is marked for deletion). For example, 
CreateFileW() fails with ERROR_ACCESS_DENIED (5) in this case. A file with its 
delete disposition set is still visibly linked in its parent directory. 

The trigger to unlink a file that's marked for deletion depends on the delete 
mode. In Windows 10, DeleteFileW() uses a POSIX delete if it's supported by the 
filesystem (e.g. NTFS). This delete mode unlinks the file as soon the file 
object that was used to set the delete disposition is closed. There's still a 
small window of time, however, in which attempts to open the file will fail 
with an access-denied error.

In os.stat(), if CreateFileW() fails with access denied, FindFirstFileW() is 
called to try to get the stat data from the file's parent directory. But in 
this case it's likely that the file has been unlinked from the directory by the 
time FindFirstFileW() is called.

The original error code from CreateFileW() gets restored if FindFirstFileW() 
fails. This is generally the right thing to do. However, if FindFirstFileW() 
fails with ERROR_FILE_NOT_FOUND (2) or ERROR_PATH_NOT_FOUND (3), then I suggest 
that the previous error code should not be restored.

For example:

switch (error) {
case ERROR_ACCESS_DENIED: /* Cannot sync or read attributes. */
case ERROR_SHARING_VIOLATION: /* It's a paging file. */
/* Try reading the parent directory. */
if (!attributes_from_dir(path, &fileInfo, &tagInfo.ReparseTag)) {
/* Cannot read the parent directory. */
DWORD dir_error = GetLastError();
if (dir_error != ERROR_FILE_NOT_FOUND &&
  dir_error != ERROR_PATH_NOT_FOUND) {
SetLastError(error);
}
return -1;
}

--
nosy: +eryksun
stage:  -> needs patch
type:  -> behavior
versions: +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



[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



[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



[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



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



[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



[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



[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



[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



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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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


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



[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



[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



[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



[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



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



[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



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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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


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


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



[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



[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



[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



[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



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

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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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
stage: patch review -> 

___
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



[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



[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



[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



[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



[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



[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



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



  1   2   >