[issue44518] Finalization of non-exhausted asynchronous generators is deferred

2021-06-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry, I do not understand what do you mean. The problem is that non-exhausted 
asynchronous generators are not finalized until asyncio.run() is finished. This 
differs from synchronous generators which are finalized as early as possible 
(in CPython).

--

___
Python tracker 

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



[issue44516] Update bundled pip to 21.1.3

2021-06-27 Thread Ned Deily


Change by Ned Deily :


--
nosy: +lukasz.langa, pablogsal
priority: normal -> high

___
Python tracker 

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



[issue44518] Finalization of non-exhausted asynchronous generators is deferred

2021-06-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can you repro this without asyncio?

--
nosy: +Guido.van.Rossum

___
Python tracker 

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



[issue44519] help(math.fabs)

2021-06-27 Thread David Lambert

David Lambert  added the comment:

Hi Ray,

I'm glad this was a conscious choice.  I found a person confused by the 
output of print(abs(3), math.fabs(3))

Perhaps the manual would mention return values->that's not an annotation.

Thanks for considering,

Dave

On 6/27/21 12:42 PM, Raymond Hettinger wrote:
> Raymond Hettinger  added the comment:
>
> Thanks for the suggestion but we've not adopted type annotations in the 
> documentation.
>
> --
> nosy: +rhettinger
> resolution:  -> rejected
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue44464] Remove flake8 exception for deprecation warning (importlib.metadata)

2021-06-27 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset f4b31cdbc043449f3df7d291da67bcb3736be0db by Miss Islington (bot) 
in branch '3.10':
bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. 
(GH-26807) (GH-26929)
https://github.com/python/cpython/commit/f4b31cdbc043449f3df7d291da67bcb3736be0db


--

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-06-27 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 17b916737bd05a11ec24341990c4d8dbfee8f94b by Jason R. Coombs in 
branch '3.9':
[3.9] bpo-37741: make importlib.metadata docs discoverable through a module 
directive. (GH-25415) (GH-26500)
https://github.com/python/cpython/commit/17b916737bd05a11ec24341990c4d8dbfee8f94b


--

___
Python tracker 

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



[issue44464] Remove flake8 exception for deprecation warning (importlib.metadata)

2021-06-27 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44464] Remove flake8 exception for deprecation warning (importlib.metadata)

2021-06-27 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset efe7d08d178a7c09bcca994f2068b019c8633d83 by Jason R. Coombs in 
branch 'main':
bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. 
(#26807)
https://github.com/python/cpython/commit/efe7d08d178a7c09bcca994f2068b019c8633d83


--

___
Python tracker 

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



[issue29466] pickle does not serialize Exception __cause__ field

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

I get different output for Serhiy's first example now, but the same for the 
second:

>>> try: import foo
... except Exception as ex: exc = ex
... 
>>> exc.name
'foo'
>>> exc.__reduce__()
(, ("No module named 'foo'",), {'name': 'foo'})
>>> exc = StopIteration()
>>> exc.value = 42
>>> exc.__reduce__()
(, ())
>>>

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.6

___
Python tracker 

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



[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-06-27 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

In https://github.com/python/importlib_metadata/issues/324, I painstakingly 
created a library to perform robust performance monitoring of behaviors in the 
library and specifically added tests that capture the performance of 
entry_points against importlib_metadata 1.4 (the same code used in Python 3.9). 
I furthermore attempted to replicate the reported performance concerns reported 
using the exact commands, and even then, Python 3.10b3 indicates a 3x+ 
improvement in performance, dispelling the claim that the issue is order of 
complexity of the resolution of entry points by group.

I'll be open to new reports about performance concerns or other regressions 
w.r.t. the importlib.metadata changes, but please do not re-open this issue.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue29466] pickle does not serialize Exception __cause__ field

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

See also issue43460, issue32696, issue30005.

--

___
Python tracker 

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



[issue30005] Pickling and copying exceptions doesn't preserve non-__dict__ attributes

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

See also issue43460, issue32696, issue29466.

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue32696] Fix pickling exceptions with multiple arguments

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

See also issue43460, issue30005, issue29466

--

___
Python tracker 

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



[issue43460] Exception copy error

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

See issue32696, issue30005, issue29466

--
components: +Library (Lib)
nosy: +iritkatriel
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



[issue40620] [doc] Range tutorial shorthand could be made clearer

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

Thank you Jack!

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



[issue40620] [doc] Range tutorial shorthand could be made clearer

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 1acd1e63850d179383fcb638dcefee4c66b3ca4e by Miss Islington (bot) 
in branch '3.9':
bpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919) 
(GH-26928)
https://github.com/python/cpython/commit/1acd1e63850d179383fcb638dcefee4c66b3ca4e


--

___
Python tracker 

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



[issue40620] [doc] Range tutorial shorthand could be made clearer

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset aeb63392e74976b4289b38f32f1d6e7ff2e0a712 by Miss Islington (bot) 
in branch '3.10':
bpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919) 
(GH-26927)
https://github.com/python/cpython/commit/aeb63392e74976b4289b38f32f1d6e7ff2e0a712


--

___
Python tracker 

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



[issue40620] [doc] Range tutorial shorthand could be made clearer

2021-06-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25498
pull_request: https://github.com/python/cpython/pull/26928

___
Python tracker 

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



[issue40620] [doc] Range tutorial shorthand could be made clearer

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 2f49c9debc2efe010c757be3bdbd6493f1ebc5f6 by jdevries3133 in 
branch 'main':
bpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919)
https://github.com/python/cpython/commit/2f49c9debc2efe010c757be3bdbd6493f1ebc5f6


--
nosy: +iritkatriel

___
Python tracker 

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



[issue40620] [doc] Range tutorial shorthand could be made clearer

2021-06-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +25497
pull_request: https://github.com/python/cpython/pull/26927

___
Python tracker 

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



[issue38062] Clarify that atexit.unregister matches by equality, not identity

2021-06-27 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue43718] HTTP CONNECT response not subject to debug level

2021-06-27 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Also note that the debug arg should be provided only if it's greater than 0, 
for cases when you might want to have connection at debug 0, and a custom 
response class with a default nonzero debug level.

--

___
Python tracker 

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



[issue17186] no way to introspect registered atexit handlers

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

See also issue32082.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue32082] atexit module: allow getting/setting list of handlers directly

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

See also issue17186.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue43718] HTTP CONNECT response not subject to debug level

2021-06-27 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Michael: Thanks for the report! would you like to create a PR? If not, I can do 
that.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44452] Allow paths to be joined without worrying about a leading slash

2021-06-27 Thread Zbyszek Jędrzejewski-Szmek

Zbyszek Jędrzejewski-Szmek  added the comment:

> I can see the need for generalized 'drive' support that sets an arbitrary 
> path prefix as the 'drive'. For example, if "/var/tmp/instroot" is a 'drive', 
> then joining it to "/some/path" returns "/var/tmp/instroot/some/path". 
> However, subsequently joining that result to "/suffix" would return 
> "/var/tmp/instroot/suffix".

I think that the "drive concept" only makes sense on Windows. With POSIX paths, 
the expectation is that you can concatenate paths recursively, and consistency 
is much more useful than the drive concept.

One special case where you might concat multiple levels of paths is when the 
paths are generated through some configuration mechanism, and an occasional 
absolute path might sneak in, but we still want to use the same "relative" 
concatenation.

For example:
def path_to_some_binary_in_container(container, usr_merge_was_done=True):
  """Construct a path with support for systems with /usr/bin and legacy systems
 with /bin (https://fedoraproject.org/wiki/Features/UsrMove).
  """
  path_to_containers = '/var/lib/machines'
  prefix = 'usr/' if usr_merge_was_done else '/'
  suffix = 'bin/some-binary'
  return path_to_containers / container / prefix / suffix

path_to_some_binary('cont1') returns 
PosixPath('/var/lib/machines/cont1/usr/bin/some-binary'), but 
path_to_some_binary('cont1', False) returns PosixPath('/bin/some-binary'). The 
"bug" is that '/' was used instead of ''. This is exactly the
pitfall that I want to avoid:
  return path_to_containers // container // prefix // suffix
will do the expected thing.

--

___
Python tracker 

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



[issue20752] Difflib should provide the option of overriding the SequenceMatcher

2021-06-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

'Pending' is pretty useless because any comment erases it.  This is a tracker 
bug that will not be fixed.

--
status: open -> pending

___
Python tracker 

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



[issue20752] Difflib should provide the option of overriding the SequenceMatcher

2021-06-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I reread the patch and my previous comment and am no more positive than I was 
then.

The one use case presented is second-hand.  Chris said "in order for [Bazaar] 
to use a custom sequence matcher, they had to essentially copy-paste and modify 
the stdlib diff methods in order to inject their own sequence matchers."  
Assuming that they did something like the patch, it is not clear why they did 
not instead patch/replace SequenceMatcher, and they are not involved here to 
speak.

Enhancements need to be of some general use with multiple use cases or users.  
When I added the SequenceMatcher autojunk parameter in 3.2 to disable the 
autojunk heuristic, there had been multiple reports of how it caused problems.  
There has been no additional support given here, including none from Tim.  One 
place to get other on board for enhancements is python-idea list.

--
assignee: tim.peters -> 
status: pending -> open

___
Python tracker 

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



[issue31314] email throws exception with oversized header input

2021-06-27 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue44452] Allow paths to be joined without worrying about a leading slash

2021-06-27 Thread Eryk Sun


Eryk Sun  added the comment:

> I was thinking about about a case where paths are resolved relative 
> to a container root in a filesystem. 

I can see the need for generalized 'drive' support that sets an arbitrary path 
prefix as the 'drive'. For example, if "/var/tmp/instroot" is a 'drive', then 
joining it to "/some/path" returns "/var/tmp/instroot/some/path". However, 
subsequently joining that result to "/suffix" would return 
"/var/tmp/instroot/suffix". The "/some/path" part is replaced by "/suffix". 
This doesn't match your example to lstrip('/') from paths joined with the 
proposed `//` operator.

--
nosy: +eryksun

___
Python tracker 

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



[issue17305] IDNA2008 encoding is missing

2021-06-27 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Maybe deprecate idna so that users are strongly prompted to consider the pypi 
idna?

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44519] help(math.fabs)

2021-06-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestion but we've not adopted type annotations in the 
documentation.

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



[issue42238] Deprecate suspicious.py?

2021-06-27 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue44512] csv.DictWriter: inconsistency in handling of extrasaction arg

2021-06-27 Thread Andrei Kulakov


Change by Andrei Kulakov :


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

___
Python tracker 

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



[issue18618] Need an atexit.register equivalent that also works in subinterps

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

I think this is a duplicate of issue31901.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue40528] Improve / Clear ASDL generator

2021-06-27 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

These were all the cleanups on my checklist, so can close the issue now. I'll 
probably create other issues if something additional comes up

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



[issue40528] Improve / Clear ASDL generator

2021-06-27 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset 107a2c59c91b3911bdd6dfdb83271c588c506a5a by Batuhan Taskaya in 
branch 'main':
bpo-40528: fix is_simple(sum)s behavior for attributes (GH-26918)
https://github.com/python/cpython/commit/107a2c59c91b3911bdd6dfdb83271c588c506a5a


--

___
Python tracker 

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



[issue44519] help(math.fabs)

2021-06-27 Thread David Lambert


New submission from David Lambert :

math.fabs returns float.
The documentation should say so, and help(math.fabs) should include the 
expected return type  -> float

fabs(x, /) -> float
Return the absolute value of the float x.

I did not check, but expect these annotations recommendations are pervasive 
throughout the python libraries.

--
assignee: docs@python
components: Documentation
messages: 396582
nosy: David Lambert, docs@python
priority: normal
severity: normal
status: open
title: help(math.fabs)
type: enhancement
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



[issue20752] Difflib should provide the option of overriding the SequenceMatcher

2021-06-27 Thread Irit Katriel


Irit Katriel  added the comment:

I agree with Terry that this proposal significantly complicates the API and the 
motivation for it is not very strong. I will close the issue in a couple of 
weeks if nobody objects.

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

___
Python tracker 

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



[issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI

2021-06-27 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I haven't observed this issue on the CI since GH-26893 through GH-26896 was 
merged. Marking this as resolved. If anyone disagrees, feel free to reopen :)

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



[issue44470] 3.11 docs.python.org in Polish not English?

2021-06-27 Thread Julien Palard


Julien Palard  added the comment:

> My computer is only configured for English. Running Firefox 90.0b9 (64-bit) 
> on macOS 11.4 (20F71).

To add to this, it had nothing to do with your setup, the file was just lying 
here on the server due to the previous build happening on the same hierarchy.

That's why adding a git clean fixed it.

Next time you find a similar issue you can easily test if it's dependent on 
your setup or not by trying a curl in command-line:

$ curl https://docs.python.org/3.11/library/parser.html

curl sends very simple requests, without looking at your locale preferences, 
like:

GET /3.11/library/parser.html HTTP/1.1
Host: docs.python.org
User-Agent: curl/7.74.0
Accept: */*

so it permit to easily disambiguate if it's tied to your browser or not.

--

___
Python tracker 

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



[issue44470] 3.11 docs.python.org in Polish not English?

2021-06-27 Thread Julien Palard


Julien Palard  added the comment:

Thanks all for reporting and following on the issue.

The fix on docsbuild script worked as expected and the page now 404 as expected 
as it does no logner exists in 3.11:

https://docs.python.org/3.11/library/parser.html

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



[issue44110] Improve string's __getitem__ error message

2021-06-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution Miguel.

I decided to not backport this change to 3.10 because the benefit is too small 
in comparison with possibility to break someone's tests.

--

___
Python tracker 

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



[issue42197] Disable automatic update of frame locals during tracing

2021-06-27 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

> > So, it's expected that `some_module` and `v` would be in the locals at this 
> > point.

> If a function does not have the local variables `some_module` and `v`, then 
> the change wouldn't be visible to the debugee.
So what difference does it make?

Right now such changes are visible to the debugee in the locals frames if a 
user does the `exec` and calls `PyFrame_FastToLocals` right afterwards (even if 
they weren't initially there).

So, it's the difference between being able to import a module and 
creating/manipulating new variables in an `exec` in any frame (as it works 
right now) or not being able to make it at all (if that feature is deprecated 
as is being implied in the PEP).

--

___
Python tracker 

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



[issue44110] Improve string's __getitem__ error message

2021-06-27 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue44110] Improve string's __getitem__ error message

2021-06-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ed1076428cca3c8dc7d075c16a575aa390e25fb8 by Miguel Brito in 
branch 'main':
bpo-44110: Improve string's __getitem__ error message (GH-26042)
https://github.com/python/cpython/commit/ed1076428cca3c8dc7d075c16a575aa390e25fb8


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42197] Disable automatic update of frame locals during tracing

2021-06-27 Thread Mark Shannon


Mark Shannon  added the comment:

> So, it's expected that `some_module` and `v` would be in the locals at this 
> point.

If a function does not have the local variables `some_module` and `v`, then the 
change wouldn't be visible to the debugee.
So what difference does it make?

--

___
Python tracker 

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



[issue44482] Possible resource leeak in glob in non-refcount implementations

2021-06-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4861fdaf25f246eb9ee4e8161c15dad26efe895d by Serhiy Storchaka in 
branch '3.9':
[3.9] bpo-44482: Fix very unlikely resource leak in glob in non-CPython 
implementations (GH-26843). (GH-26916)
https://github.com/python/cpython/commit/4861fdaf25f246eb9ee4e8161c15dad26efe895d


--

___
Python tracker 

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



[issue42197] Disable automatic update of frame locals during tracing

2021-06-27 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

@ncoghlan I took a quick look at the PEP...

I'm a bit worried about:

> On optimised frames, the Python level f_locals API will become a direct 
> read/write proxy for the frame's local and closure variable storage, and 
> hence no longer support storing additional data that doesn't correspond to a 
> local or closure variable on the underyling frame object.

In particular, it's common for a debugger to evaluate expressions in a context 
that would change the locals to add new variables.

i.e.: stopping at a breakpoint and doing 2 `exec` calls with frame.f_locals 
with:
import some_module
v = some_module.compute(xxx)

So, it's expected that `some_module` and `v` would be in the locals at this 
point.

Right now after each line of the evaluation, a `PyFrame_FastToLocals` must be 
called so things work as they should, but given that the PEP explicitly says 
that it should be deprecated, and this being a common feature for a debugger, 
what'd be the proper way to support that?

p.s.: should I ask such questions regarding the PEP somewhere else instead of 
this issue or is this an appropriate place?

--

___
Python tracker 

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



[issue44452] Allow paths to be joined without worrying about a leading slash

2021-06-27 Thread Zbyszek Jędrzejewski-Szmek

Zbyszek Jędrzejewski-Szmek  added the comment:

> It doesn't make sense to "concatenate" one absolute path to another.

Please see the original description of the issue, or Serhiy's example. I was 
thinking about about a case where paths are resolved relative to a container 
root in a filesystem. Serhiy brings up the case of a web server which 
concatenates paths from one namespace (URLs) to paths from another (fs paths).

> / has a simple explanation: if you start at /foo, and then do cd bar, you'll 
> end up in /foo/bar. But if you start at /foo, and then do cd /bar, you'll end 
> up in /bar.

You are thinking about a user doing operations in a shell. The two cases 
described are precisely NOT like this. In both examples, no matter what the 
path is, it is not allowed to go above the "root of the namespace". I.e. if you 
start at "/foo", and concatenate "/bar", you end up in "/foo/bar". If you are 
looking up "https://example.com/some/path;, you want "/srv/www/some/path", etc.

>  what to do with C:\foo\bar, C:foo\bar, \\?\c\foo\bar, etc?

I think that with those paths there is no solution. They already don't work in 
any reasonable way:

>>> pathlib.Path('/asdf') / ("C:/some/path")
>>>   
PosixPath('/asdf/C:/some/path')
>>> pathlib.Path('C:\\asdf') / ("C:/some/path") 
>>>   
PosixPath('C:\\asdf/C:/some/path')

Windows paths make no sense in the context of combination of namespaces and 
path concatenation, so I think it's fine to keep current behaviour (whatever it 
exactly is) for them. While the UNIX paths were designed to allow arbitrary 
nesting, the Windows paths were designed to always allow per-volume operations. 
The two concepts cannot be combined.

> In any case you need to have some validation to disallow "..".

Yes, that is a good point. In my code I do some validation that disallows ".." 
early on. But I think that the hypothetical //-operator should reject paths 
with "..".

> But lstrip('/') works well here. 

It kind of does, but
- it's rather verbose
- it breaks the order, because it's on the right of the argument.

I'll write to python-ideas.

--

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-27 Thread E. Paine


E. Paine  added the comment:

> Can you change labels on your own PRs?

Sadly not (hence why I need to ask for e.g. skip news)

--

___
Python tracker 

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



[issue44518] Finalization of non-exhausted asynchronous generators is deferred

2021-06-27 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

In the following example:

def gen():
try:
yield 1
finally:
print('finalize inner')

def func():
try:
for x in gen():
break
finally:
print('finalize outer')

func()
print('END')

the output in CPython is:

finalize inner
finalize outer
END


But in similar example for asynchronous generator:

async def gen():
try:
yield 1
finally:
print('finalize inner')

async def func():
try:
async for x in gen():
break
finally:
print('finalize outer')

import asyncio
asyncio.run(func())
print('END')

the output in CPython is:

finalize outer
finalize inner
END

There is a strong link somewhere which prevents finalization of the 
asynchronous generator object until leaving the outer function.

Tested on CPython 3.7-3.11. In PyPy "finalize inner" is not printed at all. 
Using closing() and aclosing() is the right way to get deterministic 
finalization, but in any case it would be better to get rid of strong link 
which prevents finalization of the asynchronous generator object.

--
components: Interpreter Core
messages: 396569
nosy: Mark.Shannon, asvetlov, gvanrossum, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Finalization of non-exhausted asynchronous generators is deferred
type: resource usage
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-06-27 Thread Julien Palard


Julien Palard  added the comment:

The previous one could probably be implemented in rstlint using (an equivalent 
of):

git grep ':[a-z]\+:``[^:` ]+``' Doc/

Maybe specialized to known roles, like the script specializes to known 
directives.

--

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-06-27 Thread Julien Palard


Julien Palard  added the comment:

Spotted a true positive in b19f45533942e4ad7ddf9d2d94f8b87c6f746bce:

:const:``None``

(I'm trying to build a true positive list, to have usefull cases where 
suspicious is usefull, so in the long term I can maybe implement those cases in 
rslint instead.)

--

___
Python tracker 

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



[issue44452] Allow paths to be joined without worrying about a leading slash

2021-06-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I understand why this problem arose. If you parse an HTTP URL, its path always 
starts with "/" if not empty. And you usually want to interpret it as a 
relative to some base directory. But lstrip('/') works well here. In any case 
you need to have some validation to disallow "..".

I think that adding yet one operation will confuse users. And what to do with 
C:\foo\bar, C:foo\bar, \\?\c\foo\bar, etc?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There were some issues with the backporting bot. Seems they were temporary.

Thank you for your contribution E. Paine. For this issue and others.

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



[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-27 Thread miss-islington


miss-islington  added the comment:


New changeset e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2 by Miss Islington (bot) 
in branch '3.10':
bpo-44404: tkinter `after` support callable classes (GH-26812)
https://github.com/python/cpython/commit/e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2


--
nosy: +miss-islington

___
Python tracker 

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



[issue42197] Disable automatic update of frame locals during tracing

2021-06-27 Thread Nick Coghlan


Nick Coghlan  added the comment:

I've updated PEP 558 with a reference back to this ticket as additional 
motivation (the update also addresses several of the fragility concerns that 
Mark raised): https://github.com/python/peps/pull/1787

There's still work to be done to bring the reference implementation into line 
with the updated proposal, but I'm making it an explicit goal to get the 
proposal submitted for pronouncement in time for inclusion in 3.11.

--
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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