[issue42758] pathlib.Path to support the "in" operator (x in y)

2020-12-28 Thread Anton Hvornum
Anton Hvornum added the comment: Missed that function, but they would behave the same without explicitly use the function call. -- ___ Python tracker ___

[issue42758] pathlib.Path to support the "in" operator (x in y)

2020-12-28 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think there's any chance we'd add "in" as an alias for "is_relative_to()", so I'm going to close this. If you disagree, you could try and get support on python-ideas, and then we can re-open this. Thanks! -- resolution: -> rejected stage:

[issue42733] io's r+ mode truncate(0)

2020-12-28 Thread 施文峰
施文峰 added the comment: hi Terry you are right i download python version 3.0.1 to check this case ''' Python 3.0.1 (r301:69556, Dec 28 2020, 14:14:02) [GCC 7.5.0] on linux5 Type "help", "copyright", "credits" or "license" for more information. >>> from test_case import test [43552 refs] >>> te

[issue42690] Aiohttp fails when using intel ax200 wireless card

2020-12-28 Thread Ronald Oussoren
Ronald Oussoren added the comment: What's the script used, is it the script in the reddit thread? The reddit thread mentions a change to the script that might help: return [await r.json() for r in responses] To: return await asyncio.gather(*(r.json() for r in responses)) Does tha

[issue32825] warn user of creation of multiple Tk instances

2020-12-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyth

[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-12-28 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +22819 pull_request: https://github.com/python/cpython/pull/23975 ___ Python tracker ___ __

[issue42750] tkinter.Variable equality inconsistency

2020-12-28 Thread Ivo Shipkaliev
Ivo Shipkaliev added the comment: Yes, I get it now. I've missed the idea. You can do: > age = tk.IntVar(value=38, name="mine") > age_str = tk.StringVar(name="mine") > is_alive = tk.BooleanVar(name="mine") > is_alive.get() True Maybe not the best example, but still, it was a misunderstanding.

[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2020-12-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Reviewed. Please check on the PR for comments. -- ___ Python tracker ___ ___ Python-bugs-list

[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: > Currently, `platform.libc_ver()` doesn't consider in case of `executable` > variable is an empty string. I'm curious. In which case sys.executable is an empty string? Do you embed Python in an application. If Python is embedded, would it be possible to sha

[issue27640] add the '--disable-test-suite' option to configure

2020-12-28 Thread Peixing Xin
Change by Peixing Xin : -- nosy: +pxinwr nosy_count: 6.0 -> 7.0 pull_requests: +22820 pull_request: https://github.com/python/cpython/pull/23886 ___ Python tracker ___

[issue42738] subprocess: don't close all file descriptors by default (close_fds=False)

2020-12-28 Thread Eryk Sun
Eryk Sun added the comment: > Python 3.7 added the support for the PROC_THREAD_ATTRIBUTE_HANDLE_LIST > in subprocess.STARTUPINFO: lpAttributeList['handle_list'] parameter. The motivating reason to add support for the WinAPI handle list was to allow changing the default to close_fds=True rega

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: There are many ways to get the current interpreter (interp) and the current Python thread state (tstate). Public C API, opaque function call: * PyInterpreterState_Get() (new in Python 3.9) * PyThreadState_Get() Internal C API, static inline functions: * _P

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: >_PyInterpreterState_GET(): > movrax,QWORD PTR [rip+0x22a7dd]# 0x743118 <_PyRuntime+568> > movrax,QWORD PTR [rax+0x10] While working on bpo-39465, I wrote PR 20767 to optimize _PyInterpreterState_GET(): single instruction instead of two:

[issue42764] HTMLParser close() issue

2020-12-28 Thread Anthony Hodson
New submission from Anthony Hodson : HTMLParser close() does not seem to dispose of previous HTML analyses. I an sending a simple test to demonstrate this, complete with functions that are part of a set of testing facilities. The problem is present for more complex HTML. -- componen

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Richard Neumann
New submission from Richard Neumann : I have use cases in which I use named tuples to represent data sets, e.g: class BasicStats(NamedTuple): """Basic statistics response packet.""" type: Type session_id: BigEndianSignedInt32 motd: str game_type: str map: str num_pla

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22821 pull_request: https://github.com/python/cpython/pull/23976 ___ Python tracker ___ __

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue42766] urllib.request.HTTPPasswordMgr uses commonprefix instead of commonpath

2020-12-28 Thread Donát Nagy
New submission from Donát Nagy : The is_suburi(self, base, test) method of HTTPPasswordMgr in the urllib.request module tries to "Check if test is below base in a URI tree", but it uses the posixpath.commonprefix() function. This is problematic because commonprefix ignores the path structure (

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: PR 23976 stores the currrent interpreter and the current Python thread state into a Thread Local Storage (TLS) using GCC/clang __thread keyword. On x86-64 using LTO and GCC -O3, _PyThreadState_GET() and _PyInterpreterState_GET() become a single MOV. Assembl

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: PR 23976 should make _PyInterpreterState_GET() more efficient, and it prepares the code base for one GIL per interpreter (which is purpose of this issue ;-)). -- ___ Python tracker

[issue42767] Review usage of atomic variables in signamodule.c

2020-12-28 Thread STINNER Victor
New submission from STINNER Victor : In bpo-41713, I ported the _signal module to the multi-phase initialization API. I tried to move the signal state into a structure to cleanup the code, but I was scared by the following atomic variables: --- static volatile struct { _Py_atom

[issue42767] Review usage of atomic variables in signamodule.c

2020-12-28 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Richard Neumann
New submission from Richard Neumann : When sublassing the built-in list, the invocation of super().__new__ will unexpectedly expand the passed arguments: class MyTuple(tuple): def __new__(cls, *items): print(cls, items) return super().__new__(cls, items) class MyList(lis

[issue42769] concurrent.futures.ProcessPoolExecutor is unable to forward exceptions with state.

2020-12-28 Thread Damien Levac
New submission from Damien Levac : When running tasks on a `ProcessPoolExecutor`, exceptions raised by the dispatched function should be pickled and accessible to the parent process through the `Future.exception` method. On Python 3.9.1 (Linux ryzen3950x 5.4.0-58-generic #64-Ubuntu SMP Wed De

[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-12-28 Thread Marc Culler
Marc Culler added the comment: Hi Ned, I have a comment about the code signing issues that would arise if the Tcl and Tk frameworks were embedded as actual subframeworks inside the Python.framework, and a user later replaced those with newer versions. The answer is that no new issues arise.

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your problem is with list.__init__ method. It expects at most one argument. tuple does not have specialized __init__ method, it inherits it from object. All work is done in tuple.__new__. list does not have specialized __new__ method, it inherits it from o

[issue42767] Review usage of atomic variables in signamodule.c

2020-12-28 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2020-12-28 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue30963] xxlimited.c XxoObject_Check should be XxoObject_CheckExact

2020-12-28 Thread hai shi
hai shi added the comment: > #define XxoObject_CheckExact(v) (Py_TYPE(v) == &Xxo_Type) `#define Xxo_CheckExact(obj) Py_IS_TYPE(obj, &Xxo_Type)` would be better to hide details now. > #define XxoObject_Check(v) PyObject_TypeCheck(v, &Xxo_Type) +1 I think the annotation will worth to be updaet

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Richard Neumann
Richard Neumann added the comment: I could have sworn, that this worked before, but it was obviously me being tired at the end of the work day. Thanks for pointing this out and sorry for the noise. -- ___ Python tracker

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-12-28 Thread miss-islington
miss-islington added the comment: New changeset bf108bb21e1d75e30bd17141cc531dd08a5e5d0c by Erlend Egeberg Aasland in branch 'master': bpo-40077: Fix typo in simplequeue_get_state_by_type() (GH-23975) https://github.com/python/cpython/commit/bf108bb21e1d75e30bd17141cc531dd08a5e5d0c

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: This core of this idea is plausible. It is a common problem for people to want to teach a class how to convert itself to and from JSON. Altering the API for dicts is a major step, so you would need to take this to python-ideas to start getting buy-in.

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +bob.ippolito ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue42770] Typo in email.headerregistry docs

2020-12-28 Thread bazwal
New submission from bazwal : The section for class email.headerregistry.ContentDispositionHeader has a typo in an attribute name: "content-disposition" should be corrected to "content_disposition". -- assignee: docs@python components: Documentation messages: 383910 nosy: bazwal, docs@

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: We could possibly fold this at the AST optimizer, though I am not sure whether this worths anything as an optimization since it is a real obscure pattern. I've only found 2 occurrences (both from a test set on a relatively ~big dataset of source code.

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- Removed message: https://bugs.python.org/msg383911 ___ Python tracker ___ ___ Python-bugs-list mailin

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: We could possibly fold this at the AST optimizer, though I am not sure whether this worths anything as an optimization since it is a real obscure pattern. I've only found 2 occurrences (both from the test suite of black) on a relatively ~big dataset of pyth

[issue42717] The python interpreter crashed with "_enter_buffered_busy"

2020-12-28 Thread Steve Stagg
Steve Stagg added the comment: I think the problem here is that the issue can only really be detected late on during interpreter shutdown. This makes recovery very hard to do. Plus the thread termination has left shared state in an unmanaged condition, so it's super dangerous to re-enter p

[issue42753] "./configure" linux chrome beta

2020-12-28 Thread Eric V. Smith
Eric V. Smith added the comment: This appears to not be a bug with Python, so I'm going to close this. If you're having additional build problems, I suggest you ask for help on the python-list mailing list, or maybe on Stack Overflow. -- resolution: -> not a bug stage: -> resolved

[issue42763] Exposing a race in the "_warnings" resulting Python parser crash

2020-12-28 Thread Steve Stagg
Steve Stagg added the comment: Looks like a duplicate of issue42717. Causing a daemonic thread to terminate while doing IO will trigger the above abort -- nosy: +stestagg ___ Python tracker _

[issue42222] Modernize integer test/conversion in randrange()

2020-12-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset a9621bb301dba44494e81edc00e3a3b62c96af26 by Raymond Hettinger in branch 'master': bpo-4: Modernize integer test/conversion in randrange() (#23064) https://github.com/python/cpython/commit/a9621bb301dba44494e81edc00e3a3b62c96af26 ---

[issue42222] Modernize integer test/conversion in randrange()

2020-12-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue42771] Implement interactive hotkey, Ctrl+L to clear the console in Windows.

2020-12-28 Thread Mike Miller
New submission from Mike Miller : The Ctrl+L as clear-screen hotkey is supported just about everywhere, Unix and Windows, with the exceptions of cmd.exe and python.exe interactive mode. As the legacy cmd.exe can be easily replaced, that leaves python.exe. Likely needs to be configured via re

[issue37319] Deprecate using random.randrange() with non-integers

2020-12-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: I merged in PR 23064. If you want to make further modifications or improvements that would be welcome. -- ___ Python tracker ___

[issue42772] randrange() mishandles step when stop is None

2020-12-28 Thread Raymond Hettinger
New submission from Raymond Hettinger : When stop is None, the step argument is ignored: >>> randrange(1000, None, 100) 651 >>> randrange(1000, step=100) 673 -- components: Library (Lib) messages: 383919 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal status: open

[issue42772] randrange() mishandles step when stop is None

2020-12-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue42772] randrange() mishandles step when stop is None

2020-12-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: rhettinger -> versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue42771] Implement interactive hotkey, Ctrl+L to clear the console in Windows.

2020-12-28 Thread Mike Miller
Mike Miller added the comment: I found an implementation of this for Windows in case it is needed. Not sure if it is the best way to do it, as the Console API is rather clumsy. However this one works to my knowledge: https://github.com/tartley/colorama/blob/master/colorama/winterm.py#L111

[issue42762] infinite loop resulted by "yield"

2020-12-28 Thread Steve Stagg
Steve Stagg added the comment: Behaviour was changed in this commit: --- commit ae3087c6382011c47db82fea4d05f8bbf514265d Author: Mark Shannon Date: Sun Oct 22 22:41:51 2017 +0100 Move exc state to generator. Fixes bpo-25612 (#1773) Move exception state information from frame object

[issue42772] randrange() mishandles step when stop is None

2020-12-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +tim.peters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue42772] randrange() mishandles step when stop is None

2020-12-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: One fix is to move up the code for converting step to istep and then modify the early out test to: if stop is None and istep == 1: if istart > 0: return self._randbelow(istart) That would have the downside of slowing

[issue42767] Review usage of atomic variables in signamodule.c

2020-12-28 Thread Ammar Askar
Ammar Askar added the comment: > For me, the most surprising part is Handlers[signum].tripped which is > declared as volatile *and* an atomic variable. I think it's just following this part of the C spec (Some background in bpo-12060): > or refers to any object with static storage duration

[issue42740] typing.py get_args and get_origin should support PEP 604 and 612

2020-12-28 Thread miss-islington
miss-islington added the comment: New changeset 4140f10a16f06c32fd49f9e21fb2a53abe7357f0 by Ken Jin in branch 'master': bpo-42740: Fix get_args for PEP 585 collections.abc.Callable (GH-23963) https://github.com/python/cpython/commit/4140f10a16f06c32fd49f9e21fb2a53abe7357f0 -- nosy:

[issue42740] typing.py get_args and get_origin should support PEP 604 and 612

2020-12-28 Thread miss-islington
Change by miss-islington : -- pull_requests: +22822 pull_request: https://github.com/python/cpython/pull/23977 ___ Python tracker ___ __

[issue42048] Document Argument Clinic's defining_class converter

2020-12-28 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- keywords: +patch pull_requests: +22823 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23978 ___ Python tracker _

[issue42740] typing.py get_args and get_origin should support PEP 604 and 612

2020-12-28 Thread miss-islington
miss-islington added the comment: New changeset 03e571f1d5f3e7a11f33bb9f47dd4acedf17b166 by Miss Islington (bot) in branch '3.9': bpo-42740: Fix get_args for PEP 585 collections.abc.Callable (GH-23963) https://github.com/python/cpython/commit/03e571f1d5f3e7a11f33bb9f47dd4acedf17b166 ---

[issue42771] Implement interactive hotkey, Ctrl+L to clear the console in Windows.

2020-12-28 Thread Eryk Sun
Eryk Sun added the comment: > As the legacy cmd.exe can be easily replaced, that leaves python.exe. python.exe is a console application, which attaches to a console session. Since Windows 7, each console session is hosted by an instance of conhost.exe. The CMD shell (cmd.exe) is a console a

[issue42770] Typo in email.headerregistry docs

2020-12-28 Thread Ammar Askar
Ammar Askar added the comment: Confirmed, the attribute under https://docs.python.org/3.10/library/email.headerregistry.html#email.headerregistry.ContentDispositionHeader is incorrect. bazwal, would you like to propose a patch to fix this? The code is here: https://github.com/python/cpython

[issue42772] randrange() mishandles step when stop is None

2020-12-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Note, we can't actually use "self.choice(range(*args))" because the underlying len() call can Overflow. If it does, the components need to be computed manually. -- ___ Python tracker

[issue42739] Crash when try to disassemble bogus code object

2020-12-28 Thread Ammar Askar
Ammar Askar added the comment: This seems to be part 2 of the problems Mark mentioned in issue42562. Namely in this case the `co_lnotab` accessor uses PyLineTable_NextAddressRange which has that assertion. -- nosy: +ammar2 ___ Python tracker

[issue42772] randrange() mishandles step when stop is None

2020-12-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Another solution is to use an identity test for the step argument _one = 1 class Random: def randrange(start, stop=None, step=_one): ... if stop is None and step is _one: if istart > 0:

[issue42772] randrange() mishandles step when stop is None

2020-12-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Another solution is to use an identity test for the step argument Should I restore that optimization in issue37319? -- ___ Python tracker __

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +22824 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23979 ___ Python tracker __

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have added a draft PR on how the idea would look like so we can discuss with a specific proposal. -- ___ Python tracker ___ ___

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Richard, > Also, using _asdict() seems strange as an exposed API, since it's an > underscore method and users hence might not be inclined to use it. I don't consider this a strong argument. Named tuple in general has to use a naming convention for publi

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not think there are serious raesons for adding this optimization. The Python compiler was intentionally made simple for maintainability. Constant folding supports only base arithmetic and bits operations because they are often used in constant express

[issue42773] build.yml workflow not testing on pushes

2020-12-28 Thread Ammar Askar
New submission from Ammar Askar : It looks like on pushes to Github, we currently aren't running tests. (Though this isn't too big of a concern since they get run on pull requests). Here's an example of a recent run https://github.com/python/cpython/runs/1609911031 ``` fatal: ambiguous argum

[issue42243] Don't access the module dictionary directly

2020-12-28 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- resolution: -> wont fix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42243] Don't access the module dictionary directly

2020-12-28 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-

[issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1

2020-12-28 Thread Cebtenzzre
Change by Cebtenzzre : -- nosy: +cebtenzzre ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue35943] PyImport_GetModule() can return partially-initialized module

2020-12-28 Thread Cebtenzzre
Change by Cebtenzzre : -- nosy: +cebtenzzre ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue42393] Raise overflow errors iso. deprecation warnings in socket.htons and socket.ntohs (was deprecated in 3.7)

2020-12-28 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +22825 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23980 ___ Python tracker ___ __

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > This is a similar case. I am -1 for this optimization. Yeah, I concur. One of the major drawbacks of this is that the normal case where this happens involves a Load(): z = "something" x = ["a", *z, "b"] I see almost no reason to nest the literals i

[issue42773] build.yml workflow not testing on pushes

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: > build.yml workflow not testing on pushes What does it mean: "on pushes"? -- ___ Python tracker ___ ___

[issue42770] Typo in email.headerregistry docs

2020-12-28 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch nosy: +ZackerySpytz nosy_count: 3.0 -> 4.0 pull_requests: +22826 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23982 ___ Python tracker

[issue42772] randrange() mishandles step when stop is None

2020-12-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Should I restore that optimization in issue37319? Yes, but to fix the bug it needs to occur earlier in the code (currently line 314): if stop is None and step is _ONE: <-- Line 314 ^ <-- Add this And again lat

[issue42770] Typo in email.headerregistry docs

2020-12-28 Thread Zackery Spytz
Zackery Spytz added the comment: I've created a fix for this error. -- versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: Mark Shannon experiment using __thread: * https://mail.python.org/archives/list/python-...@python.org/thread/RPSTDB6AEMIACJFZKCKIRFTVLAJQLAS2/ * https://github.com/python/cpython/compare/master...markshannon:threadstate_in_tls He added " extern __thread st

[issue42773] build.yml workflow not testing on pushes

2020-12-28 Thread Ammar Askar
Ammar Askar added the comment: Any commit that gets to pushed to the master, 3.9, 3.8 and 3.7 branches. e.g all the commits here https://github.com/python/cpython/commits/master, they end up failing the "Check for source changes" step and skipping even when there's non-documentation changes.

[issue42774] 'ipaddress' module, bad result for 'is_private' on "192.0.0.0"

2020-12-28 Thread Trevor Marvin
New submission from Trevor Marvin : Tested on Python 3.6.9 with "ipaddress" module, module version 1.0. ipaddress.ip_address('192.0.0.0').is_private Incorrectly returns as 'True'. Per RFC 1918 / BCP 5, section 3, the private IPv4 space sarting with '192' is only '192.168.0.0/16'. --

[issue42774] 'ipaddress' module, bad result for 'is_private' on "192.0.0.0"

2020-12-28 Thread Eric V. Smith
Eric V. Smith added the comment: The ipaddress documentation references https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml, which says that 192.0.0.0/29 is reserved and not globally reachable. I think in that sense, it's a private address. -

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue42753] "./configure" linux chrome beta

2020-12-28 Thread Gerrik Labra
Gerrik Labra added the comment: Understood. Thank you. On Mon, Dec 28, 2020 at 10:50 AM Eric V. Smith wrote: > > Eric V. Smith added the comment: > > This appears to not be a bug with Python, so I'm going to close this. If > you're having additional build problems, I suggest you ask for hel

[issue42774] 'ipaddress' module, bad result for 'is_private' on "192.0.0.0"

2020-12-28 Thread Trevor Marvin
Change by Trevor Marvin : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-

[issue42740] typing.py get_args and get_origin should support PEP 604 and 612

2020-12-28 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset efb1f0918fad2ba3346a986b0e958dc5753a7bbe by Ken Jin in branch 'master': bpo-42740: Support PEP 604, 612 for typing.py get_args and get_origin (GH-23942) https://github.com/python/cpython/commit/efb1f0918fad2ba3346a986b0e958dc5753a7bbe --

[issue42740] typing.py get_args and get_origin should support PEP 604 and 612

2020-12-28 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2020-12-28 Thread Ethan Furman
Ethan Furman added the comment: If the patch in issue42775 is committed, this problem will be solved. -- assignee: -> ethan.furman superseder: -> __init_subclass__ should be called in __init__ ___ Python tracker

[issue42775] __init_subclass__ should be called in __init__

2020-12-28 Thread Ethan Furman
New submission from Ethan Furman : PEP 487 introduced __init_subclass__ and __set_name__, and both of those were wins for the common cases of metaclass usage. Unfortunately, the implementation of PEP 487 with regards to __init_subclass__ has made the writing of correct metaclasses significant

[issue42775] __init_subclass__ should be called in __init__

2020-12-28 Thread Ethan Furman
Ethan Furman added the comment: My understanding of using keywords in class headers class MyClass(SomeBaseClass, setting='maybe'): ... is that the keywords would get passed into the super classes `__init_subclass__` (`SomeBaseClass` and `setting`). However, in the cases of - test_d

[issue42776] The string find method shows the problem

2020-12-28 Thread andy ye
New submission from andy ye : data = 'abcddd' # True data.find('a', 0) # False data.find('a', start=0) # document class str(obj): def find(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ """ S.find(sub[, start[, end]]) -> int

[issue42762] infinite loop resulted by "yield"

2020-12-28 Thread Xinmeng Xia
Xinmeng Xia added the comment: Thanks for your kind explanation! My description is a little confusing. Sorry about that. The problem here is that the program should stop when the exception is caught whatever the exception is. (I think bpo-25612 (#1773) fixed exception selection problems and

[issue42776] The string find method shows the problem

2020-12-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: # True data.find('a', 0) That will return 0, not True. # False data.find('a', start=0) And that will raise TypeError, not return False. What exactly are you reporting here? I have read your bug report, and looked at the screen shot, and I have no idea

[issue42763] Exposing a race in the "_warnings" resulting Python parser crash

2020-12-28 Thread Xinmeng Xia
Xinmeng Xia added the comment: Thank you, but I don't think this is a duplicate of issue42717. This crash is probably caused by the parameter "target" of Thread. "Target" accept the "callable object". Defaults to None. In this program, it's assigned to a "Int object". I think a pre-checking

[issue42717] The python interpreter crashed with "_enter_buffered_busy"

2020-12-28 Thread Xinmeng Xia
Xinmeng Xia added the comment: Could we try to limit the number of thread or state or something? I mean if we set parameter of "range", for example, to 1000 or less here, the crash will no longer happen. I think the parser can not handle too heavy loop so that it crashes. -- __

[issue42770] Typo in email.headerregistry docs

2020-12-28 Thread miss-islington
miss-islington added the comment: New changeset c56988b88fecf6dc70f039704fda6051a0754db1 by Zackery Spytz in branch 'master': bpo-42770: Fix a typo in the email.headerregistry docs (GH-23982) https://github.com/python/cpython/commit/c56988b88fecf6dc70f039704fda6051a0754db1 -- nosy:

[issue42770] Typo in email.headerregistry docs

2020-12-28 Thread miss-islington
Change by miss-islington : -- pull_requests: +22828 pull_request: https://github.com/python/cpython/pull/23985 ___ Python tracker ___ __

[issue42770] Typo in email.headerregistry docs

2020-12-28 Thread miss-islington
Change by miss-islington : -- pull_requests: +22827 pull_request: https://github.com/python/cpython/pull/23984 ___ Python tracker ___ __

[issue42777] WindowsPath does not implement is_mount but ntpath implements and offers a ismount method

2020-12-28 Thread David
New submission from David : pathlib.WindowsPath[0] does not implement is_mount but ntpath implements and offers a ismount[1] method. Perhaps WindowsPath is_mount can make use of ntpath.ismount ? [0] https://github.com/python/cpython/blob/master/Lib/pathlib.py#L1578 [1] https://github.com/py

[issue42770] Typo in email.headerregistry docs

2020-12-28 Thread miss-islington
miss-islington added the comment: New changeset e11639880a73f30b4009efa8d14c350932e35332 by Miss Islington (bot) in branch '3.8': bpo-42770: Fix a typo in the email.headerregistry docs (GH-23982) https://github.com/python/cpython/commit/e11639880a73f30b4009efa8d14c350932e35332 -- _

  1   2   >