[issue44596] Operand coercion breaks MappingProxyType encapsulation

2021-07-09 Thread Nick Coghlan
New submission from Nick Coghlan : The fast locals proxy implementation for PEP 558 used the existing MappingProxyType implementation as a starting point. This meant I noticed the following code in the mapping proxy comparison implementation: == static PyObject * mappingproxy_richcompare

[issue44595] round() gives wrong result

2021-07-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: Not a bug, the result is correct. Python floats are binary floating point values, not decimal. 0.3368655's actual value is exactly: 0.3368654984392928809029399417340755462646484375 so when rounding to six decimal places, the seventh decimal place i

[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-09 Thread Pierre Quentel
Pierre Quentel added the comment: Sorry, I don't know C so I can't write a PR for this change. -- ___ Python tracker ___ ___ Python

[issue44595] round() gives wrong result

2021-07-09 Thread Vedran Čačić
Vedran Čačić added the comment: Have you seen the Note at https://docs.python.org/3/library/functions.html?highlight=Note#round? -- nosy: +veky ___ Python tracker ___

[issue44595] round() gives wrong result

2021-07-09 Thread Jos Dechamps
New submission from Jos Dechamps : round(0.3368655,6) returns 0.336865 instead of 0.336866 -- messages: 397238 nosy: dechamps priority: normal severity: normal status: open title: round() gives wrong result type: behavior ___ Python tracker

[issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist

2021-07-09 Thread miss-islington
miss-islington added the comment: New changeset c89f0b2587eb0b16175a0bbb12d0b86314ff9320 by Miss Islington (bot) in branch '3.9': [3.9] bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049) (GH-27082) https://github.com/python/cpython/commit/c89

[issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist

2021-07-09 Thread miss-islington
miss-islington added the comment: New changeset 1577259cc51d0d46ad676798ce0a130039acf956 by Miss Islington (bot) in branch '3.10': bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049) https://github.com/python/cpython/commit/1577259cc51d0d46ad6

[issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist

2021-07-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 248173cc0483a9ad9261353302f1234cf9eb2ebe by andrei kulakov in branch 'main': bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049) https://github.com/python/cpython/commit/248173cc0483a9ad9261353

[issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist

2021-07-09 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25630 pull_request: https://github.com/python/cpython/pull/27081 ___ Python tracker _

[issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist

2021-07-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +25631 pull_request: https://github.com/python/cpython/pull/27082 ___ Python tracker ___ __

[issue44587] argparse BooleanOptionalAction displays default=SUPPRESS unlike other action types

2021-07-09 Thread Ned Deily
Change by Ned Deily : -- nosy: +rhettinger title: BooleanOptionalAction displays default=SUPPRESS unlike other action types -> argparse BooleanOptionalAction displays default=SUPPRESS unlike other action types ___ Python tracker

[issue44317] Suggestion for better syntax errors in tokenizer errors

2021-07-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44317] Suggestion for better syntax errors in tokenizer errors

2021-07-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 2a722d4fab6a9656f3c03cfdaf6d1684277b8af5 by Miss Islington (bot) in branch '3.10': bpo-44317: Improve tokenizer errors with more informative locations (GH-26555) (GH-27079) https://github.com/python/cpython/commit/2a722d4fab6a9656f3c03cf

[issue44573] Organize some data files in the Lib/test directory

2021-07-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> not a bug status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailin

[issue44317] Suggestion for better syntax errors in tokenizer errors

2021-07-09 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25629 pull_request: https://github.com/python/cpython/pull/27079 ___ Python tracker _

[issue44317] Suggestion for better syntax errors in tokenizer errors

2021-07-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset f24777c2b329974b69d2a3bf5cfc37e0fcace36c by Pablo Galindo Salgado in branch 'main': bpo-44317: Improve tokenizer errors with more informative locations (GH-26555) https://github.com/python/cpython/commit/f24777c2b329974b69d2a3bf5cfc37e0fc

[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-07-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Yeah, I think these should be changed, but lest give a bit of time for other core devs to mention what they think -- ___ Python tracker _

[issue43897] Implement support for validation of pattern matching ASTs

2021-07-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 2f7636887e9f978352aa47b18d5f376263663ba1 by Batuhan Taskaya in branch '3.10': [3.10] bpo-43897: ast validation for pattern matching nodes (GH-27074) https://github.com/python/cpython/commit/2f7636887e9f978352aa47b18d5f376263663ba1 -

[issue44594] AsyncExitStack.enter_async_context() is mishandling exception __context__

2021-07-09 Thread John Belmonte
New submission from John Belmonte : Over at the Trio project, we have evidence that `AsyncExitStack.enter_async_context(foo())` is not actually equivalent to `async with foo()` regarding raised exception context. The symptom is a very long, unhelpful tracebacks because the __context__ of rai

[issue44571] itertools: takedowhile()

2021-07-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: > For convenience, the takewhile iterator can also have > additional attributes: a boolean attribute which indicates > that the falsifying element is set, and dynamic attribute > which is equal to orig_iterator > or chain([odd_element], orig_iterator). R

[issue42909] Email header with ; ; ; ; stuffing takes very long to parse

2021-07-09 Thread Andrei Kulakov
Andrei Kulakov added the comment: According to this: https://stackoverflow.com/questions/19852/maximum-length-of-a-mime-content-type-header-field (with links to RFCs 4288 and 6838), this header should not be longer than 255 chars. To fix this issue while maximizing backwards compatibility,

[issue44583] Failure to build on OSF1.

2021-07-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: On 7/9/2021 5:29 PM, Jay Krell wrote: > Probably. What does "support" mean? This is not my ballpark. One can also access pydev as newsgroup gmane.comp.python.devel at news.gmane.io -- ___ Python tracker

[issue44593] _randbelow_with_getrandbits may request an unnecessary random bit

2021-07-09 Thread lormuc
Change by lormuc : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue44583] Failure to build on OSF1.

2021-07-09 Thread Jay Krell
Jay Krell added the comment: > "credible offer to maintain platform support for several years." Probably. What does "support" mean? Fix user-reported bugs? I expect very few/zero. Run a buildbot? Maybe. Not sure it is worthwhile, depending on frequency. Provide little autoconf/ifdef patches

[issue44593] _randbelow_with_getrandbits may request an unnecessary random bit

2021-07-09 Thread Mark Dickinson
Mark Dickinson added the comment: See #37000 for previous discussion. -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bu

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Akuli
Akuli added the comment: Unfortunately I don't know any real-world examples of this on Windows. The open file dialog works very differently on Windows: it uses the native Windows dialog, whereas on Linux, it's implemented in Tcl. Meanwhile, here's a platform-independent toy example: imp

[issue734176] Make Tkinter.py's nametowidget work with cloned menu widgets

2021-07-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: See #44592, closed as duplicate of this. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am not quite convinced that this is a duplicate of #734176. The latter is about tearoff clones and nothing is cloned here. But I do notice that number 'names were also prefixed with '#'. What happens if 'tearoff=0' is added to the cascade so that it is no

[issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called

2021-07-09 Thread Andrei Kulakov
Andrei Kulakov added the comment: Mieczysław: perfect, thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Akuli, what tk widgets do you think are not known to tkinter? In any case, tk menu is known to tkinter. I cannot reproduce when running on Windows with 3.10.0b3: Add "print(root.children)" (after add_cascade) results in {'!menu': , '!menu2': }. The names

[issue44593] _randbelow_with_getrandbits may request an unnecessary random bit

2021-07-09 Thread lormuc
New submission from lormuc : For example, Lib/random.py/Random._randbelow_with_getrandbits(1) should always return 0, as per docstring, but it asks for 1 random bit from getrandbits(). -- components: Library (Lib) messages: 397219 nosy: lormuc priority: normal severity: normal status:

[issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called

2021-07-09 Thread Mieczysław Torchała
Mieczysław Torchała added the comment: Hi Andrei! In my case it was: OSError: [Errno 24] Too many open files -- ___ Python tracker ___ __

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Akuli
Akuli added the comment: I found issue734176 before I created this. It is NOT a duplicate. While issue734176 is about menus, this one is about focus_get(), and not necessarily related to menus. In fact, I initially noticed this with an "open file" dialog, not with a menu. I'm not putting my

[issue34550] UnicodeDecodeError when invoke method configure() of Menu instance

2021-07-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> out of date stage: -> resolved status: pending -> closed ___ Python tracker ___ ___

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a duplicate of issue734176. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Make Tkinter.py's nametowidget work with cloned menu widgets ___ Python tracker

[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-09 Thread Guido van Rossum
Guido van Rossum added the comment: Agreed with everything that Brandt said. These wording issues are subtle! Note in particular that the original wording implies that {‘x’: 1, ‘x’: 1, z: 1} would be a runtime error, but it clearly should be a compile time error.-- --Guido (mobile) --

[issue44516] Update bundled pip to 21.1.3

2021-07-09 Thread Stéphane Bidoul
Stéphane Bidoul added the comment: Yes, I close the issue. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44516] Update bundled pip to 21.1.3

2021-07-09 Thread Stéphane Bidoul
Change by Stéphane Bidoul : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread E. Paine
E. Paine added the comment: Sorry, I should specify that we would use `winfo class` in order to then return a new tkinter object for the existing Tk widget (which currently cannot be done) -- ___ Python tracker

[issue44583] Failure to build on OSF1.

2021-07-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Jay, this issue and PR should either be closed, or you should post on pydev list saying why support should be re-enabled, along with a credible offer to maintain platform support for several years. -- nosy: +terry.reedy _

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread E. Paine
E. Paine added the comment: I agree with Akuli that raising a KeyError is not expected behaviour (combined with the fact this is caught elsewhere), and therefore is probably a regression. While we could use `winfo class` to determine the type of Tk widget, this would probably require a reaso

[issue44560] Many MUA don't recognize charset "eucgb2312_cn" in email header

2021-07-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Anything before 3.9 only gets security patches. -- nosy: +terry.reedy title: Unrecognized charset "eucgb2312_cn" in email header for many MUA -> Many MUA don't recognize charset "eucgb2312_cn" in email header versions: -Python 3.6, Python 3.7, Python

[issue44550] Spam

2021-07-09 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: -skoolbeep ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called

2021-07-09 Thread Andrei Kulakov
Andrei Kulakov added the comment: Can someone w/access to a Linux system confirm if running out of FDs raises an OSError? Something like this: N = `ulimit -n` + 5 for x in range(N): tempfile.mkstemp() -- ___ Python tracker

[issue20116] urlparse.parse_qs should take argument for query separator

2021-07-09 Thread Jacob Walls
Jacob Walls added the comment: Greetings. I believe this is mooted by #42967 as well as changes even prior to that. https://bugs.python.org/issue42967 -- nosy: +jacobtylerwalls ___ Python tracker _

[issue27875] Syslogs /usr/sbin/foo as /foo instead of as foo

2021-07-09 Thread Ned Deily
Change by Ned Deily : -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> syslog: Default "ident" in syslog.openlog() shouldn't contain slash versions: +Python 3.9 -Python 3.5, Python 3.6, Python 3.8 __

[issue44539] Imghdr JPG Quantized

2021-07-09 Thread Éric Araujo
Change by Éric Araujo : -- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker ___ ___ Python-

[issue44533] Where are the log file(s)

2021-07-09 Thread Éric Araujo
Change by Éric Araujo : -- resolution: third party -> not a bug stage: -> resolved status: pending -> closed ___ Python tracker ___

[issue44577] Probably defect in Python 3.7.11

2021-07-09 Thread Ned Deily
Ned Deily added the comment: That excerpt is not executable by itself. Without a reproducible test case and better traceback info, there is not enough information here to investigate further. -- nosy: +ned.deily ___ Python tracker

[issue44516] Update bundled pip to 21.1.3

2021-07-09 Thread Jacob Walls
New submission from Jacob Walls : Greetings, all. I take it this is fully resolved? -- nosy: +jacobtylerwalls ___ Python tracker ___ ___

[issue44571] itertools: takedowhile()

2021-07-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For convenience, the takewhile iterator can also have additional attributes: a boolean attribute which indicates that the falsifying element is set, and dynamic attribute which is equal to orig_iterator or chain([odd_element], orig_iterator). --

[issue44573] Organize some data files in the Lib/test directory

2021-07-09 Thread Leonardo Freua
Change by Leonardo Freua : -- status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-09 Thread Brandt Bucher
Brandt Bucher added the comment: Sorry, that should be PEP 634, not 638. -- ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-09 Thread Brandt Bucher
Brandt Bucher added the comment: Nice find! In my opinion, we should do two things here: - Update PEP 638 to specify that a SyntaxError is raised "if *any duplicate* key patterns are literal patterns". This was absolutely our original intention... I think the nuances were just lost in the fi

[issue44587] BooleanOptionalAction displays default=SUPPRESS unlike other action types

2021-07-09 Thread Jacob Walls
Change by Jacob Walls : -- components: +Library (Lib) type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue44571] itertools: takedowhile()

2021-07-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've done some API experiments using a data munging example. See attached file. The proposed API for takewhile() to save the last attribute is somewhat awkward to use: it = iter(report) tw_it = takewhile(is_header, it) for line in takewhile(i

[issue44591] Added max heap push

2021-07-09 Thread Ritav Das
Change by Ritav Das : -- resolution: later -> rejected status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[issue44591] Added max heap push

2021-07-09 Thread Ritav Das
Ritav Das added the comment: But why not? It's plays a very pivotal role when in competitive coding and solving python coding questions in general. Making them public would help thousands of fellow coders like me by making this process more convenient. -- resolution: rejected -> lat

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Akuli
Akuli added the comment: Forgot to mention: The correct fix IMO would be to return None when a KeyError occurs. This way code like `focus_get() == some_tkinter_widget` would always do the right thing, for example. -- ___ Python tracker

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Akuli
New submission from Akuli : The purpose of focus_get() is to return the widget that currently has the focus. It tries to convert its result to a tkinter widget, which can fail, because not all Tk widgets are known to tkinter. Consider this, for example: import tkinter def print_focus

[issue44591] Added max heap push

2021-07-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the suggestion, but only the minheap functions are public. The maxheap functions are private, for internal use only. Currently, there is no internal need for a maxheap push. -- resolution: -> rejected stage: patch review -> resolved

[issue44573] Organize some data files in the Lib/test directory

2021-07-09 Thread Leonardo Freua
Change by Leonardo Freua : -- stage: -> resolved status: open -> closed type: -> enhancement ___ Python tracker ___ ___ Python-bug

[issue44591] Added max heap push

2021-07-09 Thread Zachary Ware
Change by Zachary Ware : -- components: +Library (Lib) -Windows nosy: +rhettinger -zach.ware stage: -> patch review versions: +Python 3.11 -Python 3.9 ___ Python tracker ___ _

[issue44207] Add a version number to Python functions

2021-07-09 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +25628 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27078 ___ Python tracker ___ ___

[issue44591] Added max heap push

2021-07-09 Thread Ritav Das
Change by Ritav Das : -- title: Added man heap push -> Added max heap push ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue44591] Added man heap push

2021-07-09 Thread Ritav Das
New submission from Ritav Das : Added a heap push method for the max heap invariant and added try except block at the end so the user can import that function from the library. -- components: Windows messages: 397197 nosy: paul.moore, ritavdas, steve.dower, tim.golden, zach.ware priori

[issue44590] Create frame objects lazily when needed

2021-07-09 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +25626 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27077 ___ Python tracker ___ ___

[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue44590] Create frame objects lazily when needed

2021-07-09 Thread Mark Shannon
New submission from Mark Shannon : In https://bugs.python.org/issue44032 we moved most of the data in the frame stack, that is the locals, stack, and "specials" (globals, builtins, code etc), from the heap allocated stack to a (mostly) contiguous array in memory. That offered some speed up due

[issue44589] Pattern Matching - duplicate keys in mapping patterns

2021-07-09 Thread Pierre Quentel
New submission from Pierre Quentel : PEP 634 specifies that "A mapping pattern may not contain duplicate key values. (If all key patterns are literal patterns this is considered a syntax error; otherwise this is a runtime error and will raise ValueError.)" but this is not what happens with t

[issue44583] Failure to build on OSF1.

2021-07-09 Thread Ronald Oussoren
Ronald Oussoren added the comment: As mentioned on the PR: Support for OSF1 was removed in Python 3.3 (see https://www.python.org/dev/peps/pep-0011/#unsupporting-platforms). I expect that there will be little interest amongst the core developers for reintroducing support because OSF1 is an

[issue44588] Possible double Py_XDECREF in cpython typeobject.c

2021-07-09 Thread Ziyue Jiang
Ziyue Jiang added the comment: I just take over a Python3.6 project from a friend, migrating it to the newest Python version. Then this problem happened. After debugging, I think it's a possible double Py_XDECREF if using C-API like this. But I'm not familiar with Python C-API before so I'm n

[issue44588] Possible double Py_XDECREF in cpython typeobject.c

2021-07-09 Thread Ziyue Jiang
Ziyue Jiang added the comment: Sorry, not inherited from Time, Time is the class I use in a real project. Time -> A -- ___ Python tracker ___ _

[issue44588] Possible double Py_XDECREF in cpython typeobject.c

2021-07-09 Thread Ziyue Jiang
Ziyue Jiang added the comment: I have no detailed code. The way to I produce it is that using PyType_FromSpec() to generate a type A without the flag Py_TPFLAGS_DEFAULT(which sets the flag Py_TPFLAGS_HAVE_VERSION_TAG). Then compile and run in Python. from my_pkg import A class Time1(Time):

[issue44588] Possible double Py_XDECREF in cpython typeobject.c

2021-07-09 Thread Irit Katriel
Irit Katriel added the comment: Do you have a small piece of code reproducing it that you can upload? -- nosy: +iritkatriel ___ Python tracker ___

[issue44588] Possible double Py_XDECREF in cpython typeobject.c

2021-07-09 Thread Ziyue Jiang
Ziyue Jiang added the comment: Maybe a little complicared but you can still construct a case to trigger the double free action, thus causing a SIGABRT. Program received signal SIGABRT, Aborted. 0x77c3718b in raise () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt #0 0x77c3718b

[issue44588] Possible double Py_XDECREF in cpython typeobject.c

2021-07-09 Thread Ziyue Jiang
New submission from Ziyue Jiang : The type_mro_modified() function in Object/typeobject.c may produce double Py_XDECREF on mro_meth and type_mro_meth when enter the code: if (!_PyType_HasFeature(cls, Py_TPFLAGS_HAVE_VERSION_TAG) || !PyType_IsSubtype(type, cls)) { goto clear; } I think mr