[issue39085] Improve docs for await expression

2019-12-18 Thread Kyle Stanley
Kyle Stanley added the comment: > Sorry, my English is bad; I cannot help with docs too much. No problem. Your feedback is still incredibly helpful and very much appreciated either way. (: > Anyway, technically an awaited coroutine *can* be suspended but the > suspension is not always

[issue39094] Add a default to statistics.mean and related functions

2019-12-18 Thread Tal Einat
Tal Einat added the comment: It seems to me that this would follow the same argument as in issue #18111: The real issue is that there's no good way to check if an arbitrary iterable is empty, unlike with sequences. Currently, callers need to wrap with try/except to handle empty iterators

[issue39094] Add a default to statistics.mean and related functions

2019-12-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I vote -1. We don't have defaults for stdev() or median() or mode(). And it isn't clear what one would use for a meaningful default value in most cases. Also, I'm not seeing anything like this in Pandas, Excel, etc. So, I recommend keeping the

[issue39093] tkinter objects garbage collected from non-tkinter thread cause panic and core dump

2019-12-18 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gpolo, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39095] Negative Array Index not Yielding "Index Out Of Bounds"

2019-12-18 Thread NNN
NNN added the comment: Ahh, thanks. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37218] Default hmac.new() digestmod has not been removed from documentation

2019-12-18 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39091] CPython Segfault in 5 lines of code

2019-12-18 Thread Noah
Change by Noah : -- keywords: +patch pull_requests: +17126 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17658 ___ Python tracker ___

[issue39095] Negative Array Index not Yielding "Index Out Of Bounds"

2019-12-18 Thread Zachary Ware
Zachary Ware added the comment: `-1` is not out of bounds unless the array is empty; negative indices count from the other end: >>> a = list("some array") >>> a ['s', 'o', 'm', 'e', ' ', 'a', 'r', 'r', 'a', 'y'] >>> a[-1] 'y' >>> b = [] >>> b[-1] Traceback (most recent call last): File "",

[issue39095] Negative Array Index not Yielding "Index Out Of Bounds"

2019-12-18 Thread NNN
New submission from NNN : Created an 2D array: bigFloorLayout = [] bigFloorLayout=[[False for row in range(0,45] for col in range(0,70] for y in range (offsetY, storageY + offsetY): for x in range (offsetX, storageX + offsetX): bigFloorLayout[x][y] =

[issue39093] tkinter objects garbage collected from non-tkinter thread cause panic and core dump

2019-12-18 Thread obserience
obserience added the comment: A quick google search for "Tcl_AsyncDelete: async handler deleted by the wrong thread" yields plenty of users complaining about this error case. Usually they're trying add a gui to an existing application. They run it in a thread other than main and then leak a

[issue39094] Add a default to statistics.mean and related functions

2019-12-18 Thread Yoni Lavi
Change by Yoni Lavi : -- keywords: +patch pull_requests: +17124 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17657 ___ Python tracker ___

[issue39094] Add a default to statistics.mean and related functions

2019-12-18 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +rhettinger, steven.daprano, taleinat ___ Python tracker ___ ___ Python-bugs-list

[issue39094] Add a default to statistics.mean and related functions

2019-12-18 Thread Yoni Lavi
New submission from Yoni Lavi : I would like to put forward an argument in favour of a `default` parameter in the statistics.mean function and the related function. What motivated me to open this is that my code would more often than not include a check (or try-except) whenever I calculate

[issue39093] tkinter objects garbage collected from non-tkinter thread cause panic and core dump

2019-12-18 Thread obserience
New submission from obserience : All tkinter objects have a reference to the TCL interpreter object "self.tk". The current cleanup code does not remove these when a widget is destroyed. Garbage collection of the TCL interpreter object occurs only after all gui objects are garbage collected.

[issue38295] test_relative_path of test_py_compile fails on macOS 10.15 Catalina

2019-12-18 Thread Ned Deily
Ned Deily added the comment: New changeset 13ee023c03caf85101778b9323cdffbad695a4e0 by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-38295: prevent test_relative_path of test_py_compile failure on macOS Catalina (GH-17636)

[issue39035] Travis CI fail on backports: pyvenv not installed

2019-12-18 Thread Ned Deily
Ned Deily added the comment: New changeset 9af497419540cdb4659927e66c67d861c5ea48c2 by Ned Deily (Inada Naoki) in branch '3.7': bpo-39035: travis: Don't use beta group (GH-17604) https://github.com/python/cpython/commit/9af497419540cdb4659927e66c67d861c5ea48c2 --

[issue1298835] Add a vendor-packages directory for system-supplied modules

2019-12-18 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1116520] Prefix search is filesystem-centric

2019-12-18 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39091] CPython Segfault in 5 lines of code

2019-12-18 Thread Noah
Noah added the comment: I'm not sure if this will actually appear as a message (I just registered for the bug tracker and I'm not sure how it works), but I wrote the gist and I can definitely make a PR. -- nosy: +coolreader18 ___ Python tracker

[issue39070] Uninstalling 3.8.0 fails but it says it succeeds..

2019-12-18 Thread tuijatuulia
tuijatuulia added the comment: alright have some, I'll just put them here, I guess nothing secret there. There are quite many of those - and also log files say it is uninstalling properly but no, it did not disappear from Windows / Programs or files did not go anywhere, also when I

[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2019-12-18 Thread Martin Panter
Martin Panter added the comment: FTR I have been trialling a patched Python 3.7 based on Maru's changes (revision 6ac217c) + review suggestions, and it has reduced the size of the leak (hit 1 GB over a couple days, vs only 60 MB increase over three days). The remaining leak could be

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-12-18 Thread Martin Panter
Change by Martin Panter : -- nosy: +martin.panter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue900092] hotshot.stats.load fails with AssertionError

2019-12-18 Thread SilentGhost
Change by SilentGhost : -- resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread miss-islington
miss-islington added the comment: New changeset b8bbdf049b0472b8edc4298bfa61e62e3a584e98 by Miss Islington (bot) in branch '3.7': bpo-38546: Fix concurrent.futures test_ressources_gced_in_workers() (GH-17652) (GH-17655)

[issue39092] Csv sniffer doesn't attempt to determine and set escape character.

2019-12-18 Thread Evan
New submission from Evan : I observed a false positive for the csv sniffer has_header method. (It thought there was a header when there was not.) This is due to the fact that in has_header, it determines the csv dialect by sniffing it, and failed to determine that the file I was using had an

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset b0eb046cbd0dbb7b17f16aad6de20fac5305f387 by Victor Stinner in branch '3.8': bpo-38546: Fix concurrent.futures test_ressources_gced_in_workers() (GH-17652) (GH-17655)

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +17123 pull_request: https://github.com/python/cpython/pull/17656 ___ Python tracker ___

[issue900092] hotshot.stats.load fails with AssertionError

2019-12-18 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39091] CPython Segfault in 5 lines of code

2019-12-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good catch! Since you already investigated the code, do you mind to create a PR which fixes a crash? I think that adding PyExceptionInstance_Check() in _PyErr_CreateException() could fix the issue. -- ___

[issue39091] CPython Segfault in 5 lines of code

2019-12-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29688] Add support for Path.absolute()

2019-12-18 Thread Brett Cannon
Brett Cannon added the comment: I have opened https://bugs.python.org/issue39090 to track updating the pathlib docs to have a section on getting the absolute path in various ways along with what the trade-offs are for each approach. -- ___ Python

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-12-18 Thread Adam
Adam added the comment: I ran into this bug as well, and opened an issue for it (before I saw this issue): https://bugs.python.org/issue39074 Was there a conclusion on the best way to fix this? It seems like the previous __del__ implementation would correct the resource leakage by removing

[issue39091] CPython Segfault in 5 lines of code

2019-12-18 Thread Christian Heimes
Christian Heimes added the comment: I can reproduce the issue on master: >>> class E(BaseException): ... def __new__(cls, *args, **kwargs): ... return cls ... >>> def a(): yield ... >>> a().throw(E) Program received signal SIGSEGV, Segmentation fault. _Py_DECREF (op=,

[issue39091] CPython Segfault in 5 lines of code

2019-12-18 Thread Sebastian Krause
New submission from Sebastian Krause : The following lines trigger a segmentation fault: class E(BaseException): def __new__(cls, *args, **kwargs): return cls def a(): yield a().throw(E) Source with a bit more explanation:

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2019-12-18 Thread Brett Cannon
New submission from Brett Cannon : The question on how best to get an absolute path from a pathlib.Path object keeps coming up (see https://bugs.python.org/issue29688, https://discuss.python.org/t/add-absolute-name-to-pathlib-path/2882/, and

[issue39081] pathlib '/' operator does not resolve Enums with str mixin as expected

2019-12-18 Thread Ethan Furman
Ethan Furman added the comment: The other option is to continue to inherit from `str`, but override the `__str__` method: class MyEnum(str, enum.Enum): # def __str__(self): return self.value -- ___ Python tracker

[issue39089] Update IDLE's credits

2019-12-18 Thread Tal Einat
New submission from Tal Einat : The "Credits" document in the "About" dialog could use some updating. It fails to mention Saimadhav Heblikar's important work during GSoC 2014 as well as Terry J. Reedy's tireless work over the past few years which has helped keep IDLE in working order and the

[issue39014] test_concurrent_futures: test_crash() timed out on AMD64 Fedora Rawhide Refleaks 3.x

2019-12-18 Thread STINNER Victor
STINNER Victor added the comment: Another timeout on AMD64 Fedora Rawhide LTO + PGO 3.7: https://buildbot.python.org/all/#/builders/63/builds/21 test_all_completed (test.test_concurrent_futures.ProcessPoolForkWaitTest) ... 0.14s ok Timeout (0:15:00)! Thread 0x7f4983fff700 (most recent

[issue39088] test_concurrent_futures crashed with python.core core dump on AMD64 FreeBSD Shared 3.x

2019-12-18 Thread STINNER Victor
New submission from STINNER Victor : Yesterday and today, I pushed two test_concurrent_futures fixes in bpo-38546: * commit 673c39331f844a80c465efd7cff88ac55c432bfb * commit 9707e8e22d80ca97bf7a9812816701cecde6d226 Maybe it fixed this crash, maybe not.

[issue39081] pathlib '/' operator does not resolve Enums with str mixin as expected

2019-12-18 Thread Brett Cannon
Brett Cannon added the comment: Karthikeyan is right and this is working as expected. If you want the semantics you're after you can either implement __fspath__ as was suggested or get the 'value' attribute of the enum when constructing your path. -- nosy: +brett.cannon resolution:

[issue39014] test_concurrent_futures: test_crash() timed out on AMD64 Fedora Rawhide Refleaks 3.x

2019-12-18 Thread STINNER Victor
STINNER Victor added the comment: Another issue on AMD64 Fedora Rawhide Refleaks 3.7 where test_map_chunksize() hangs. https://buildbot.python.org/all/#/builders/133/builds/18 (...) test_initializer (test.test_concurrent_futures.ProcessPoolForkInitializerTest) ... 0.13s ok

[issue39070] Uninstalling 3.8.0 fails but it says it succeeds..

2019-12-18 Thread Steve Dower
Steve Dower added the comment: It will be in your user TEMP directory: C:\Users\\AppData\Local\Temp (or just type "%TEMP%" into the File Explorer address bar and it will take you there) They should all start with "Python" and end with ".log" (or be marked as text files if you don't see the

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread STINNER Victor
Change by STINNER Victor : -- versions: +Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread STINNER Victor
STINNER Victor added the comment: > bpo-38546: Fix concurrent.futures test_ressources_gced_in_workers() (GH-17652) I tested manually on the RHEL8 worker and I confirm that this change prevents the reap_children() warning. I close the issue. The change will be shortly backported to 3.7 and

[issue39077] Numeric formatting inconsistent between int, float and Decimal

2019-12-18 Thread Michael Amrhein
Michael Amrhein added the comment: Mark, Eric, sometimes the pressure to be backwards compatible is more of a curse than a blessing. But I can live with your decision. And, yes, I will create two separate issues regarding the docs. -- ___ Python

[issue39070] Uninstalling 3.8.0 fails but it says it succeeds..

2019-12-18 Thread tuijatuulia
tuijatuulia added the comment: Thank you for the suggestion - I did not find any python-related log files in Windows /Temp - is there some identification I could search for? -- ___ Python tracker

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +17122 pull_request: https://github.com/python/cpython/pull/17655 ___ Python tracker ___

[issue39087] [C API] No efficient C API to get UTF-8 string from unicode object.

2019-12-18 Thread STINNER Victor
Change by STINNER Victor : -- title: No efficient API to get UTF-8 string from unicode object. -> [C API] No efficient C API to get UTF-8 string from unicode object. ___ Python tracker

[issue39087] No efficient API to get UTF-8 string from unicode object.

2019-12-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +17121 pull_request: https://github.com/python/cpython/pull/17654 ___ Python tracker ___

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset 673c39331f844a80c465efd7cff88ac55c432bfb by Victor Stinner in branch 'master': bpo-38546: Fix concurrent.futures test_ressources_gced_in_workers() (GH-17652) https://github.com/python/cpython/commit/673c39331f844a80c465efd7cff88ac55c432bfb

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +17120 pull_request: https://github.com/python/cpython/pull/17653 ___ Python tracker ___

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +17119 pull_request: https://github.com/python/cpython/pull/17652 ___ Python tracker ___

[issue33961] Inconsistency in exceptions for dataclasses.dataclass documentation

2019-12-18 Thread Fabio Sangiovanni
Fabio Sangiovanni added the comment: Hi, I was looking at the dataclasses docs and it seems to me that the PR associated to this issue has been merged into 3.7 only, but should be backported to 3.8 and to master. I will post a comment on the PR itself as well. Thanks, Fabio --

[issue39086] Division "/" error on Long Integers

2019-12-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looking at your first example, you calculate: >>> 63945173192649609/13 4918859476357662.0 which is correct when using floats (64-bit C doubles). 64 bits are not enough to be any more precise, and you would get the same result in C or any other

[issue39086] Division "/" error on Long Integers

2019-12-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Please don't post unnecessary screen shots of text. They are impossible for us to copy your code, we have to re-type it from scratch, and retyping 17-digit numbers is prone to typos. Screenshots make it difficult or impossible for the blind and visually

[issue39087] No efficient API to get UTF-8 string from unicode object.

2019-12-18 Thread Inada Naoki
New submission from Inada Naoki : Assume you are writing an extension module that reads string. For example, HTML escape or JSON encode. There are two courses: (a) Support three KINDs in the flexible unicode representation. (b) Get UTF-8 data from the unicode. (a) will be the fastest on

[issue39086] Division "/" error on Long Integers

2019-12-18 Thread Mradul Tiwari
New submission from Mradul Tiwari : I'm a Competitive programmer and got Wrong Answer because of this division issue, which I figured out post Contest. Please See the attached screenshot. The "/" operator gives float division but for long integers, it's giving integer answer. I've tested it

[issue39085] Improve docs for await expression

2019-12-18 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks for raising the very interesting question! Sorry, my English is bad; I cannot help with docs too much. Anyway, technically an awaited coroutine *can* be suspended but the suspension is not always necessary. The most deep awaited function decides.

[issue39077] Numeric formatting inconsistent between int, float and Decimal

2019-12-18 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with your approach, Mark. And Michael: thanks for your report on the C behavior. I just wish we'd thought to look at this 13 years ago when .format() was being discussed. -- ___ Python tracker

[issue39077] Numeric formatting inconsistent between int, float and Decimal

2019-12-18 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Eric. I'm now convinced that we shouldn't weaken the Decimal behaviour, and I agree that it's risky to change the float and int behaviour. So it's sounding as though we're looking at a "won't fix" resolution here. There are still the documentation

[issue24416] Have date.isocalendar() return a structseq instance

2019-12-18 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +17118 pull_request: https://github.com/python/cpython/pull/17651 ___ Python tracker ___

[issue39082] AsyncMock is unable to correctly patch static or class methods

2019-12-18 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Found Raymond's answer on the difference between __dict__ and attribute lookup regarding descriptors to be useful here : https://stackoverflow.com/a/44600603 -- ___ Python tracker

[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-12-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset 35acb3597208e10a101140474adec86859d57f61 by Victor Stinner in branch '3.8': bpo-38546: multiprocessing tests stop the resource tracker (GH-17641) (GH-17647) https://github.com/python/cpython/commit/35acb3597208e10a101140474adec86859d57f61

[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2019-12-18 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Attaching a test case for this issue since the self.error code path was not 
covered in the current test suite. A PR is open proposing match variable 
initialisation with None