[issue44804] Port fix of "issue44422" to Python3.6.x

2021-08-01 Thread Ned Deily
Ned Deily added the comment: Sorry you are running into this problem. Alas, Python 3.6 has been in the "security-fix-only" phase of its life cycle for over 2.5 years now and will reach end-of-life in several months at the end of 2021. Our criteria for changes to a "security" branch are: "The

[issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.."

2021-08-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka nosy_count: 2.0 -> 3.0 pull_requests: +26048 pull_request: https://github.com/python/cpython/pull/27538 ___ Python tracker _

[issue44793] Arguments ignored in substitution in typing.Callable

2021-08-01 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26047 pull_request: https://github.com/python/cpython/pull/27537 ___ Python tracker _

[issue44793] Arguments ignored in substitution in typing.Callable

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f92b9133ef67e77605cbd315b6b6c81036ce110e by Serhiy Storchaka in branch 'main': bpo-44793: Fix checking the number of arguments when subscribe a generic type with ParamSpec parameter. (GH-27515) https://github.com/python/cpython/commit/f92b913

[issue44804] Port fix of "issue44422" to Python3.6.x

2021-08-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +ned.deily ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue20703] RuntimeError caused by lazy imports in pdb

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Having a side effect at import time is not good. It will interfere with programs which just import pdb, but not use it. There are two other options: 1. Import readline at top level, but call set_completer_delims() lazily. 2. Do not import readline at all.

[issue32397] textwrap output may change if you wrap a paragraph twice

2021-08-01 Thread Andrei Kulakov
Andrei Kulakov added the comment: This issue is due to *drop_whitespace* arg being True by default. Documentation states that *drop_whitespace* applies after wrapping, so the fix in the PR would break that promise because, as far as I understand, it applies the wrapping after *drop_whitespac

[issue44804] Port fix of "issue44422" to Python3.6.x

2021-08-01 Thread Arun
New submission from Arun : We have seen multiple occurrences of the issue reported and fixed in https://bugs.python.org/issue44422, on RHEL8.3 with Python3.6.x. I understand RHEL8.4 is also shipping with Python3.6.x as the default version and it's going to be the same with RHEL8.5 as well.

[issue42235] [macOS] Use --enable-optimizations in build-installer.py

2021-08-01 Thread Ned Deily
Change by Ned Deily : -- pull_requests: -24521 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue41980] Argparse documentation is slightly misleading

2021-08-01 Thread Andrei Kulakov
Andrei Kulakov added the comment: Yannick: the PRs are submitted via github; you can find more detail on contributions workflow / process here: https://devguide.python.org/ -- nosy: +andrei.avk ___ Python tracker

[issue44782] LRU class given as example in OrderedDict docs not work on pop

2021-08-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: > But if you need lru_cache() why not use lru_cache() > from the stdlib? This gives a foundation for people who want to roll their own variants of the standard library lru_cache(). From here, people can experiment with pickle support, dynamic resizing,

[issue44782] LRU class given as example in OrderedDict docs not work on pop

2021-08-01 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +26046 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27536 ___ Python tracker __

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I am not sure how far we should backport these changes > if backport them. We've had no reports of the current code causing problems for any existing applications (except the LRU recipe in the docs), so there is likely no value in making backports. Ins

[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-08-01 Thread Joshua Bronson
Change by Joshua Bronson : -- nosy: +jab ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue31724] test_xmlrpc_net should use something other than buildbot.python.org

2021-08-01 Thread Irit Katriel
Irit Katriel added the comment: The test is now skipped, but still need to be fixed. -- keywords: -patch nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7 ___ Python tracker

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 27528 makes the C implementation of OrderedDict.popitem() consistent with the Python implementation (do not call overridden __getitem__ and __setitem__). PR 27530 changes also both implementations of OrderedDict.pop(). It simplifies the C code, but adds

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26045 pull_request: https://github.com/python/cpython/pull/27530 ___ Python tracker ___

[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-08-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: > It is hard to get rid of the execution lock once > it was introduced, but I think we should do it. It's likely some apps are relying on the locking feature. So if we can fix it, we should do prefer that over more disruptive changes. Addenda to my code s

[issue41973] Docs: TypedDict is now of type function instead of class

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually most names defined in typing are no longer classes. -- assignee: -> docs@python components: +Documentation nosy: +docs@python, gvanrossum, kj versions: +Python 3.11 ___ Python tracker

[issue41973] Docs: TypedDict is now of type function instead of class

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: TypeDict is a callable, it can be used as Point2D = TypedDict('Point2D', x=int, y=int, label=str) It can also be used as a base in class definition, but is is not a class itself. It does not occur in __bases__ of the created class, and it cannot be us

[issue44782] LRU class given as example in OrderedDict docs not work on pop

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree that composition is methodologically more correct than inheritance for implementing a variant of lru_cache(). But if you need lru_cache() why not use lru_cache() from the stdlib? I think that instead of showing a poor version of the lru_cache() dec

[issue42038] Tracemalloc's format() doc contradictory

2021-08-01 Thread Andrei Kulakov
Andrei Kulakov added the comment: I agree that the doc is wrong; I've put up the tiny PR here: https://github.com/python/cpython/pull/27529/files Note that linecache.getline() returns line with \n but is then .strip()'ed. -- ___ Python tracker

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Let's do the right thing and fix the pure python OrderedDict.pop() method as well. -- ___ Python tracker ___

[issue42038] Tracemalloc's format() doc contradictory

2021-08-01 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +26044 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27529 ___ Python tracker

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26043 pull_request: https://github.com/python/cpython/pull/27528 ___ Python tracker ___

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is complicated. The pure Python implementation of OrderedDict.popitem() and OrderedDict.pop() are not consistent. The former uses dict.pop() which doesn't call __getitem__ and __setitem__. The latter calls __getitem__ and __setitem__. The C implementati

[issue42019] Override MagicMock special methods

2021-08-01 Thread Irit Katriel
Irit Katriel added the comment: + Michael, in case he has something to add. -- nosy: +michael.foord ___ Python tracker ___ ___ Pyth

[issue42019] Override MagicMock special methods

2021-08-01 Thread Andrei Kulakov
Andrei Kulakov added the comment: I think this can be closed. -- nosy: +andrei.avk ___ Python tracker ___ ___ Python-bugs-list mail

[issue44789] CPython cannot be compiled with -pedantic

2021-08-01 Thread Dennis Clarke
Dennis Clarke added the comment: Oh, I think we can give up on -pedantic and -pedantic-errors. It is just a nifty litmus paper test to see how code cranks under nasty contraints. I would be hapyp with iso9899:1999 or even iso9899:2011. Thank you for the feedback and the excellent response time

[issue44789] CPython cannot be compiled with -pedantic

2021-08-01 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I understand where you are coming from and I do agree, but this is something bigger than just what we can do in an issue, as it spawns multiple other places (again, many files fail with -pedantic). Is not a titanic task but is also not straightforward

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was reverted because it did not keep the C version in harmony with the pure Python version. In the pure Python version pop() calls __getitem__ and __delitem__ which can be overridden in subclasses of OrederedDict. My patch always called dict.__getitem__

[issue41973] Docs: TypedDict is now of type function instead of class

2021-08-01 Thread Andrei Kulakov
Andrei Kulakov added the comment: I haven't looked too much into typing module, so take this with a grain of salt, but my understanding is that TypedDict is a special construct (as the first sentence in the docs defines it), which can be used as a base. I think most users would consider some

[issue44789] CPython cannot be compiled with -pedantic

2021-08-01 Thread Dennis Clarke
Dennis Clarke added the comment: I very likely do not understand what is happening here. From my little perspective the Python project has become far too critical to be yet another language that can not be ported and used just about anywhere. I often port software from various places into stran

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2021-08-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I think Serhiy's patch here (before revert) may be a > good idea (to re-apply). That seems sensible to me as well. It keeps the C version in harmony with the pure python version and it follows how regular dict's are implemented. Serhiy, do you remembe

[issue37398] contextlib.ContextDecorator decorating async functions

2021-08-01 Thread Nick Coghlan
Nick Coghlan added the comment: You are correct that this proposal is technically rejected, rather than being a true duplicate of the AsyncContextManager addition. The core problem with the automatic inference idea is that it isn't possible for the standard library to reliably distinguish at

[issue44782] LRU class given as example in OrderedDict docs not work on pop

2021-08-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Possible replacement recipes: -- Implement as a class - class LRU: def __init__(self, func, maxsize=128): self.func = func self.d = OrderedDict() def __call__(self, *args): if args in self.d: va

[issue43596] change assertRaises message when wrong exception is raised

2021-08-01 Thread Irit Katriel
Irit Katriel added the comment: I agree. That’s what the “usually” was for. -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue43596] change assertRaises message when wrong exception is raised

2021-08-01 Thread Mark Dickinson
Mark Dickinson added the comment: I think I understand where the request comes from: in the case where you've changed the exception type that an API is expected to raise, and you've either updated the test to check for the new exception type and missed an update in the business logic, or vic

[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-08-01 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +carljm, ncoghlan, pydanny ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue44803] change tracemalloc.BaseFilter to an abstract class

2021-08-01 Thread Anton Grübel
Change by Anton Grübel : -- keywords: +patch pull_requests: +26042 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27527 ___ Python tracker ___

[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-08-01 Thread Nick Coghlan
Nick Coghlan added the comment: Ouch, you're right - I forgot that dict just returned NotImplemented from comparisons and unions and made it the other operand's problem: >>> d1 = dict(x=1) >>> d2 = dict(x=1) >>> from types import MappingProxyType as proxy >>> d1.__eq__(proxy(d2)) NotImplement

[issue44803] change tracemalloc.BaseFilter to an abstract class

2021-08-01 Thread Anton Grübel
New submission from Anton Grübel : during some work on typeshed I found the BaseFilter class in tracemalloc and it totally looks like and is used as a typical abstract class. I will also directly create the PR :) if you think I'm missing something, I'm happy to hear some other thoughts. -

[issue22240] argparse support for "python -m module" in help

2021-08-01 Thread Nick Coghlan
Nick Coghlan added the comment: (Note: this is an old enough ticket that it started out with patch files on the tracker rather than PRs on GitHub. That's just a historical artifact, so feel free to open a PR as described in the devguide if you would prefer to work that way) There are two co

[issue43183] Asyncio can't close sockets properly on Linux cause CLOSE_WAIT

2021-08-01 Thread Nathan Collins
Nathan Collins added the comment: What was the resolution for this issue? I'm experiencing asyncio.StreamReader.readline() hanging forever on a socket in CLOSE_WAIT state. -- nosy: +NathanCollins ___ Python tracker

[issue44590] Create frame objects lazily when needed

2021-08-01 Thread Nick Coghlan
Nick Coghlan added the comment: The newly linked pull request isn't actually for this ticket, it's for bpo-44800, a follow-up refactoring proposal related to the variable, struct field, and API naming schemes used for the new lighter weight execution frames. However, the commit message and P

[issue20779] Add pathlib.chown method

2021-08-01 Thread Emmanuel Arias
Change by Emmanuel Arias : -- versions: +Python 3.11 -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue20779] Add pathlib.chown method

2021-08-01 Thread Emmanuel Arias
Emmanuel Arias added the comment: Hello! I also use it frequently, but looking this issue I can agree with pitrou that there aren't lot of people that use chown. If I'm not wrong, there's a trend to move os to pathlib, perhaps chown should be in pathlib too :) I can work on this. ---

[issue44802] Substitution does not work after ParamSpec substitution of the user generic with a list of TypeVars

2021-08-01 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : If the user generic with ParamSpec parameter substituted with a parametrised list containing TypeVar, that TypeVar cannot be substituted. >>> from typing import * >>> T = TypeVar("T") >>> P = ParamSpec("P") >>> class X(Generic[P]): ... f: Callable[P,

[issue43596] change assertRaises message when wrong exception is raised

2021-08-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Irit. The test is failed in any case, so you need to look at the code to fix it. For the same reason we do not have assertNotRaises(). -- nosy: +serhiy.storchaka ___ Python tracker

[issue44186] TimedRotatingFileHandler overwrite log

2021-08-01 Thread Harry
Harry added the comment: The issue appears when the TimedRotatingHandler rolls over to a filename that already exists. Running your bash script, the handler correctly rolls over so you end up with the expected behaviour. This issue arises in the case that there is already a file with the tar

[issue43596] change assertRaises message when wrong exception is raised

2021-08-01 Thread Irit Katriel
Irit Katriel added the comment: Another way to look at it is that your test has two problems. One is that the expected exception didn’t happen and the other is that an unexpected exception happened. The two problems are usually unrelated, and trying to conflate them into one error message c

[issue44800] Code readability: rename interpreter frames to execution frames

2021-08-01 Thread Nick Coghlan
Nick Coghlan added the comment: PR for this proposed refactoring is now up, with a review requested from Mark: https://github.com/python/cpython/pull/27525/ The PR mostly follows what I originally posted, except that I went with _Py_execution_frame and _PyExecFrame for the struct and typedef

[issue44800] Code readability: rename interpreter frames to execution frames

2021-08-01 Thread Nick Coghlan
Change by Nick Coghlan : -- keywords: +patch pull_requests: +26040 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27525 ___ Python tracker

[issue44590] Create frame objects lazily when needed

2021-08-01 Thread Nick Coghlan
Change by Nick Coghlan : -- nosy: +ncoghlan nosy_count: 3.0 -> 4.0 pull_requests: +26041 pull_request: https://github.com/python/cpython/pull/27525 ___ Python tracker ___ _

[issue25947] Installation problem

2021-08-01 Thread Jon Camilleri
Jon Camilleri added the comment: this is your call, sorry. On Tue, Jun 22, 2021 at 4:06 PM Irit Katriel wrote: > > Irit Katriel added the comment: > > Version 3.5 is no longer supported. If you are having issues installing a > current version (3.9+) please create a new issue. > > --

[issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec

2021-08-01 Thread Ken Jin
Ken Jin added the comment: > Type expression is coerced to a list of parameter arguments in substitution > of ParamSpec. It's not, only the repr is like that. Internally it's not coerced. >>> C[int, str] typing.Callable[[int], str] >>> C[int, str].__args__ (, ) Because Callable's correct fo

[issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec

2021-08-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Library (Lib) dependencies: +Arguments ignored in substitution in typing.Callable type: -> behavior versions: +Python 3.10, Python 3.11 ___ Python tracker ___

[issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec

2021-08-01 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Type expression is coerced to a list of parameter arguments in substitution of ParamSpec. For example: >>> from typing import * >>> T = TypeVar('T') >>> P = ParamSpec('P') >>> C = Callable[P, T] >>> C[int, str] typing.Callable[[int], str] int becomes [in