[issue41316] tarfile: Do not write full path in FNAME field

2020-07-16 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue41134] distutils.dir_util.copy_tree FileExistsError when updating symlinks

2020-07-16 Thread Tom Hale
Change by Tom Hale : -- keywords: +patch pull_requests: +20651 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14464 ___ Python tracker ___ ___

[issue41319] IDLE 3.8 can not save and run this file

2020-07-16 Thread 宋嘉腾
New submission from 宋嘉腾 : If I delete the chinese in this py file, it can run. I use notepad and edit it, and it can run derectly in cmd. -- assignee: terry.reedy components: IDLE files: tempconvert.py messages: 373797 nosy: terry.reedy, 宋嘉腾 priority: normal severity: normal status: open

[issue41318] Better error message of "Cannot recover from stack overflow."

2020-07-16 Thread Heyi Tang
New submission from Heyi Tang : Is it possible to add more detailed message for the error "Cannot recover from stack overflow"? Something like "Cannot recover from stack overflow, it may be caused by catching a RecursionError but reaching the limit again before properly handling it." Maybe th

[issue38656] mimetypes for python 3.7.5 fails to detect matroska video

2020-07-16 Thread Michael Lazar
Michael Lazar added the comment: Greetings, I just encountered this issue [0] and I agree with the sentiment that the documentation is currently misleading. Particularly, > By default, it provides access to the same database as the rest of this > module. The initial database is a copy of th

[issue41311] Add a function to get a random sample from an iterable (reservoir sampling)

2020-07-16 Thread Tim Peters
Tim Peters added the comment: Thanks! That explanation really helps explain where "geometric distribution" comes from. Although why it keeps taking k'th roots remains a mystery to me ;-) Speaking of which, the two instances of exp(log(random())/k) are numerically suspect. Better written as

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Eric V. Smith
Eric V. Smith added the comment: I suggest you discuss this on python-ideas, since we'll need to reach consensus there, first. -- components: +Interpreter Core -IO, Library (Lib) ___ Python tracker

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Charles Machalow
Charles Machalow added the comment: In terms of multiple parameters, I propose adding a method to control the defaults used by !p. Though the defaults would work more than well enough for basic log and print usage. -- ___ Python tracker

[issue40456] Complete adding silent mode for py_compile

2020-07-16 Thread Cameron Simpson
Cameron Simpson added the comment: Since bad input causes py_compile.py to issue an error like this: File "/usr/local/Cellar/python@3.8/3.8.3/Frameworks/Python.framework/Versions/3.8/lib/python3.8/py_compile.py", line 213, in main if quiet < 2: NameError: name 'quiet' is not defined I

[issue41316] tarfile: Do not write full path in FNAME field

2020-07-16 Thread Emmanuel Arias
Emmanuel Arias added the comment: Hi, If I understand correctly, the name that you are using into the tar is the basename of the file. I didn't test it yet, but this PR will remove the possibility to create a file into the tar using the source tree folder? Maybe we can think about implement a

[issue29778] [CVE-2020-15523] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-07-16 Thread Larry Hastings
Larry Hastings added the comment: I must have taken my stupid pills today. Why is this considered a "security" "release blocker"? If you can put files in the root of the hard drive where Windows was installed, surely you have other, easier attack vectors. -- __

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with Raymond that it's unlikely that this will work, as a practical matter. In addition to the other problems mentioned, there's the issue of the many parameters to control pprint. And I agree with pprint, or a replacement, needing a redesign. I think

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Charles Machalow
Charles Machalow added the comment: One of the key things for ppformat here is to format long spanning dicts/lists to multiple lines, that look easy to read in a log. I feel as though that feature/usefulness outweigh potential indentation weirdness. A lot of the usage would probably be towar

[issue41312] add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: If the python-ideas discussion is fruitful, go ahead and re-open this tracker item. Personally, I don't see how this would work. The pretty printing routines rely on knowing their current level of indentation. Also, much of the "prettiness" comes from

[issue41315] Add mathematical functions as wrappers to decimal.Decimal methods

2020-07-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Stefan. This would mostly be a waste. Also, the APIs aren't completely harmonious because the Decimal methods accept an optional context object. -- ___ Python tracker

[issue41300] IDLE: add missing import io in iomenu.py

2020-07-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Łukasz, Please cherry-pick the 3.8 backport, ffeb920, as it has a 3.8-specific fixup to idlelib/NEWS.txt. I verified the bug and fix on Windows. I am leaving this open to add automated tests. -- keywords: -patch stage: patch review -> test needed

[issue41300] IDLE: add missing import io in iomenu.py

2020-07-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset ffeb9202540c07d384f82ff3ab86c37c1433283a by Miss Islington (bot) in branch '3.8': [3.8] bpo-41300: IDLE - save files with non-ascii chars (GH-21512) https://github.com/python/cpython/commit/ffeb9202540c07d384f82ff3ab86c37c1433283a --

[issue41300] IDLE: add missing import io in iomenu.py

2020-07-16 Thread miss-islington
miss-islington added the comment: New changeset 5a7aa280457423b97512810d6d9baac37f99fbf4 by Miss Islington (bot) in branch '3.9': bpo-41300: IDLE - save files with non-ascii chars (GH-21512) https://github.com/python/cpython/commit/5a7aa280457423b97512810d6d9baac37f99fbf4 -- _

[issue41311] Add a function to get a random sample from an iterable (reservoir sampling)

2020-07-16 Thread Oscar Benjamin
Oscar Benjamin added the comment: To be clear I suggest that this could be a separate function from the existing sample rather than a replacement or a routine used internally. The intended use-cases for the separate function are: 1. Select from something where you really do not want to build

[issue41306] test_tk test_widgets.ScaleTest fails with Tk 8.6.10

2020-07-16 Thread Ned Deily
Ned Deily added the comment: I can reproduce that test failure with Tk 8.6.10 on macOS, along with a few others. I believe various small things have changed in Tk somewhere between 8.6.8 and 8.6.10 in ways that affect some of the Python Tk gui tests, like test_tk and test_ttk_guionly. Some o

[issue41300] IDLE: add missing import io in iomenu.py

2020-07-16 Thread miss-islington
Change by miss-islington : -- pull_requests: +20649 pull_request: https://github.com/python/cpython/pull/21514 ___ Python tracker ___ __

[issue41300] IDLE: add missing import io in iomenu.py

2020-07-16 Thread miss-islington
Change by miss-islington : -- keywords: +patch nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +20648 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/21513 ___ Python tracker

[issue41300] IDLE: add missing import io in iomenu.py

2020-07-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 38d3864efe914fda64553e2ec75c9ec15574483f by Terry Jan Reedy in branch 'master': bpo-41300: IDLE - save files with non-ascii chars (GH-21512) https://github.com/python/cpython/commit/38d3864efe914fda64553e2ec75c9ec15574483f -- __

[issue41315] Add mathematical functions as wrappers to decimal.Decimal methods

2020-07-16 Thread Stefan Krah
Stefan Krah added the comment: The top level decimal.py that dispatches to either _decimal or _pydecimal is pure Python. So perhaps these applications could add these methods themselves: >>> import decimal >>> def exp(x): ... return x.exp() ... >>> decimal.exp = exp >>> >>> from decima

[issue41317] sock_accept() does not remove server socket reader on cancellation

2020-07-16 Thread Alex Grönholm
New submission from Alex Grönholm : Unlike with all the other sock_* functions, sock_accept() only removes the reader on the server socket when the socket becomes available for reading (ie. when there's an incoming connection). If the operation is cancelled instead, the reader is not removed.

[issue41300] IDLE: add missing import io in iomenu.py

2020-07-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Łukasz, please pull this simple fix to a 3.9.0b4 and 3.8.4 regression into 3.8.5. It disabled saving files with non-ascii chars. -- keywords: +3.8regression -patch nosy: +lukasz.langa priority: normal -> release blocker stage: patch review -> test nee

[issue41310] micro-optimization: increase our float parsing speed by Nx

2020-07-16 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think we'd want to fall back to strtod, but rather to the code we already use (Gay's). So this would increase our maintenance burden. I'm also not convinced that we actually spend a lot of time in this code, but of course profiling would be needed to

[issue41313] sys.setrecursionlimit: OverflowError still raised when int limited in sys.maxsize

2020-07-16 Thread Stefan Krah
Stefan Krah added the comment: Mark has already mentioned that setting the recursion limit to a value higher than 2000-1 makes no sense. Apart from that, sys.maxsize is actually documented like this: maxsize -- the largest supported length of containers. So it applies to Py_ssize_t (

[issue41300] IDLE: add missing import io in iomenu.py

2020-07-16 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +20647 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/21512 ___ Python tracker __

[issue41305] Add StreamReader.readinto()

2020-07-16 Thread Yury Selivanov
Yury Selivanov added the comment: > By the way if we will eventually combine StreamReader and StreamWriter won't > this function (readinto) be useful then? Yes. But StreamReader and StreamWriter will stay for the foreseeable future for backwards compatibility pretty much frozen in time. So

[issue41305] Add StreamReader.readinto()

2020-07-16 Thread Tony
Tony added the comment: By the way if we will eventually combine StreamReader and StreamWriter won't this function (readinto) be useful then? Maybe we should consider adding it right now. Tell me your thoughts on this. -- ___ Python tracker

[issue41311] Add a function to get a random sample from an iterable (reservoir sampling)

2020-07-16 Thread Tim Peters
Tim Peters added the comment: Pro: focus on the "iterable" part of the title. If you want to, e.g., select 3 lines "at random" out of a multi-million-line text file, this kind of reservoir sampling allows to do that holding no more than one line in memory simultaneously. Materializing an ite

[issue41305] Add StreamReader.readinto()

2020-07-16 Thread Tony
Tony added the comment: > Which brings me to the most important point: what we need it not coding it > (yet), but rather drafting the actual proposal and posting it to > https://discuss.python.org/c/async-sig/20. Once a formal proposal is there > we can proceed with the implementation. Pos

[issue41310] micro-optimization: increase our float parsing speed by Nx

2020-07-16 Thread Tim Peters
Tim Peters added the comment: Gregory, care to take their code and time it against Python? I'm not inclined to: reading the comments in the code, they're trying "fast paths" already described in papers by Clinger and - later - by Gay. When those fast paths don't apply, they fall back on the

[issue41306] test_tk failure on Arch Linux

2020-07-16 Thread Felix Yan
Felix Yan added the comment: tkinter.TCL_VERSION: 8.6 tkinter.TK_VERSION: 8.6 tkinter.info_patchlevel: 8.6.10 It's always reproducible in either a real desktop or Xvfb with arbitrary resolution etc as far as I have tested. -- ___ Python tracker <

[issue41306] test_tk failure on Arch Linux

2020-07-16 Thread Ned Deily
Ned Deily added the comment: What version of Tk is being used? It's in the output from: python3 -m test.pythoninfo or however you invoke python. -- nosy: +ned.deily ___ Python tracker

[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-16 Thread Matthias Klose
Matthias Klose added the comment: David, which issue number is this? -- nosy: +doko ___ Python tracker ___ ___ Python-bugs-list mai

[issue39017] Infinite loop in the tarfile module

2020-07-16 Thread Larry Hastings
Change by Larry Hastings : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue41305] Add StreamReader.readinto()

2020-07-16 Thread Yury Selivanov
Yury Selivanov added the comment: > Is it simply combining stream reader and stream writer into a single object > and changing the write() function to always wait the write (thus deprecating > drain) and that's it? Pretty much. We might also rename a few APIs here and there, like "close()"

[issue39017] Infinite loop in the tarfile module

2020-07-16 Thread Larry Hastings
Larry Hastings added the comment: New changeset cac9ca8ed99bd98f4c0dcd1913a146192bf5ee84 by Petr Viktorin in branch '3.5': [3.5] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (#21489) https://github.com/python/cpython/commit/cac9ca8ed99bd98f4c0dcd1913a146192bf5ee84 ---

[issue41286] Built-in platform module does not offer to check for processor instructions

2020-07-16 Thread Ammar Askar
Ammar Askar added the comment: Thanks for your understanding Boštjan, closing this as requested. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker _

[issue41286] Built-in platform module does not offer to check for processor instructions

2020-07-16 Thread Boštjan Mejak
Boštjan Mejak added the comment: Thanks for letting me know about py-cpuinfo. It is a very good tool. It solves my problem. This Python issue can now be closed as "Won't fix". -- ___ Python tracker _

[issue41313] sys.setrecursionlimit: OverflowError still raised when int limited in sys.maxsize

2020-07-16 Thread Mark Dickinson
Mark Dickinson added the comment: Setting to pending; I don't see any bug here, and I suspect the original report was based on a misunderstanding of what sys.setrecursionlimit is for. -- resolution: -> not a bug status: open -> pending ___ Python

[issue41310] micro-optimization: increase our float parsing speed by Nx

2020-07-16 Thread Mark Dickinson
Mark Dickinson added the comment: Is there a description of the algorithms or ideas used anywhere? The blog post you link to has no details, and I don't see any useful descriptions in the GitHub README or the source; trawling through the source to figure out what the key ideas are is not ide

[issue41316] tarfile: Do not write full path in FNAME field

2020-07-16 Thread Artem Bulgakov
Change by Artem Bulgakov : -- keywords: +patch pull_requests: +20646 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21511 ___ Python tracker ___ _

[issue41316] tarfile: Do not write full path in FNAME field

2020-07-16 Thread Artem Bulgakov
New submission from Artem Bulgakov : tarfile sets FNAME field to the path given by user: Lib/tarfile.py:424 It writes full path instead of just basename if user specified absolute path. Some archive viewer apps like 7-Zip may process file incorrectly. Also it creates security issue because an

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2020-07-16 Thread Keith Blaha
Keith Blaha added the comment: > TBH this is not very elegant, but I think you can go ahead with this (at > least as a quick fix) since I don't see a better solution yet. Agreed, given that the current workaround of implementing them in the same module works I think I will stick with that wh

[issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError

2020-07-16 Thread Chris Meyer
Change by Chris Meyer : -- nosy: +cmeyer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue41304] python 38 embed ignore python38._pth file on windows

2020-07-16 Thread Steve Dower
Steve Dower added the comment: For clarity, this was caused by the fix for issue29778, and was only released in 3.8.4 and 3.9.0b4. No other versions had a release before the fix was merged. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed __

[issue29778] [CVE-2020-15523] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-07-16 Thread Steve Dower
Steve Dower added the comment: FYI, issue41304 fixed a regression in this patch in 3.7 and later. The regression shipped in 3.8.4 and 3.9.0b4, but will be fixed in the subsequent releases. -- ___ Python tracker

[issue41045] f-string's "debug" feature is undocumented

2020-07-16 Thread Ama Aje My Fren
Change by Ama Aje My Fren : -- nosy: +amaajemyfren nosy_count: 5.0 -> 6.0 pull_requests: +20645 pull_request: https://github.com/python/cpython/pull/21509 ___ Python tracker __

[issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError

2020-07-16 Thread Bas Nijholt
Bas Nijholt added the comment: I have noticed the following on Linux too: ``` Traceback (most recent call last): File "/config/custom_components/kef_custom/aiokef.py", line 327, in _disconnect await self._writer.wait_closed() File "/usr/local/lib/python3.7/asyncio/streams.py", line 323

[issue41315] Add mathematical functions as wrappers to decimal.Decimal methods

2020-07-16 Thread Jean Abou Samra
Change by Jean Abou Samra : -- title: Add mathematical functions as wrapper to decimal.Decimal methods -> Add mathematical functions as wrappers to decimal.Decimal methods ___ Python tracker

[issue41315] Add mathematical functions as wrapper to decimal.Decimal methods

2020-07-16 Thread Jean Abou Samra
New submission from Jean Abou Samra : Common mathematical functions such as sqrt(), exp(), etc. are available for decimal numbers as methods of decimal.Decimal instances (like https://docs.python.org/3/library/decimal.html#decimal.Decimal.exp). This does not pair well with the math and cmath

[issue41314] __future__ doc and PEP 563 conflict

2020-07-16 Thread wyz23x2
Change by wyz23x2 : -- assignee: -> docs@python components: +Documentation nosy: +docs@python versions: +Python 3.10, Python 3.7 ___ Python tracker ___ ___

[issue41314] __future__ doc and PEP 563 conflict

2020-07-16 Thread wyz23x2
New submission from wyz23x2 : In https://docs.python.org/3/library/__future__.html: annotations | 3.7.0b1 | *4.0* | PEP 563: Postponed evaluation of annotations In PEP 563: Starting with Python 3.7, a __future__ import is required to use the described functionality. No warnings are raised. In

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2020-07-16 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > I was thinking that similarly to __required_keys__ and __optional_keys__, the > TypedDict could preserve its original bases in a new dunder attribute, and > get_type_hints could work off of that instead of MRO when it is dealing with > a TypedDict. I woul

[issue40477] Python Launcher app on macOS 10.15 Catalina fails to run scripts

2020-07-16 Thread wyz23x2
Change by wyz23x2 : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue41313] sys.setrecursionlimit: OverflowError still raised when int limited in sys.maxsize

2020-07-16 Thread Eric V. Smith
Change by Eric V. Smith : -- title: OverflowError still raised when int limited in sys.maxsize -> sys.setrecursionlimit: OverflowError still raised when int limited in sys.maxsize ___ Python tracker ___

[issue41313] OverflowError still raised when int limited in sys.maxsize

2020-07-16 Thread Mark Dickinson
Mark Dickinson added the comment: The recursion depth and recursion limit are stored internally as C ints, so yes, 2**31 - 1 = 2147483647 is the maximum value that you can pass to `sys.setrecursionlimit` that won't fail immediately. But it's unclear why you'd ever want to set the recursion l

[issue41305] Add StreamReader.readinto()

2020-07-16 Thread Tony
Tony added the comment: Ok actually that sounds really important, I am interested. But to begin doing something like this I need to know what's the general design. Is it simply combining stream reader and stream writer into a single object and changing the write() function to always wait the

[issue41313] OverflowError still raised when int limited in sys.maxsize

2020-07-16 Thread wyz23x2
wyz23x2 added the comment: Tested. 2**31-31 is the max, which is 2147483617, compared to sys.maxsize's 9223372036854775807! -- type: -> behavior ___ Python tracker ___ _

[issue41313] OverflowError still raised when int limited in sys.maxsize

2020-07-16 Thread wyz23x2
wyz23x2 added the comment: Needs to add 10 zeros (sys.maxsize//100) to get it work. //200 doesn't work. Python version: 3.8.4 Platform: Windows 10 2004 -- ___ Python tracker

[issue41313] OverflowError still raised when int limited in sys.maxsize

2020-07-16 Thread wyz23x2
New submission from wyz23x2 : Consider this code: import sys sys.setrecursionlimit(sys.maxsize) Causes this: OverflowError: Python int too large to convert to C int So what is the limit? It should be sys.maxsize. These 2 also don't work: sys.setrecursionlimit(sys.maxsize-1) sys.setrecursionlimit