[issue40100] Unexpected behavior when handling emoji under codec cp936

2020-03-29 Thread Alex
New submission from Alex <2423067...@qq.com>: Python 3.8.2 IDLE has an unexpected behavior. When I insert an emoji into IDLE like ''. Then I found I can't delete it(by typing backspace). When I type the left arrow then it became '��'(U+FFFD). Then I type the left arrow again, then it is ''

[issue40051] Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?)

2020-03-29 Thread wyz23x2
wyz23x2 added the comment: My opinion: I think No.2 makes more sense to users that visit the docs directly by https://docs.python.org/3.8/library/lib2to3.html; they will copy the "docs.python.org/version/library/modulename.html" format from other modules. But I also agree it's fragile. No.3

[issue40024] Add PyModule_AddType helper function

2020-03-29 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40003] test.regrtest: add an option to run test.bisect_cmd on failed tests, use it on Refleaks buildbots

2020-03-29 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40100] IDLE: Undesired behavior of emoji in editor.

2020-03-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Terminal codepages are irrelevant in the IDLE tk based gui. The problem is that windows codes astral chars as two surrogates. While tkinter can display them, after recent changes to _tkinter, the text widget cannot handle then properly when editing. This

[issue33725] Python crashes on macOS after fork with no exec

2020-03-29 Thread Mouse
Mouse added the comment: Tried 'spawn', 'fork', 'forkserver'. - 'spawn' causes consistent `FileNotFoundError: [Errno 2] No such file or directory`; - 'fork' consistently works (tested on machines with 4 and 20 cores); - 'forkserver' causes roughly half of the processes to crash with

[issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round'

2020-03-29 Thread hai shi
hai shi added the comment: > I believe it's a known problem with either `import_fresh_module` or `datetime` after removed the cleanup operation of `sys.modules` in PR19213, the testcases is successed in my local vm(I am not sure there have any other potential risks). --

[issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round'

2020-03-29 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +18576 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19213 ___ Python tracker ___

[issue33725] Python crashes on macOS after fork with no exec

2020-03-29 Thread Mouse
Mouse added the comment: The fix applied for this problem actually broke multiprocessing on MacOS. The change to the new default 'spawn' from 'fork' causes program to crash in spawn.py with `FileNotFoundError: [Errno 2] No such file or directory`. I've tested this on MacOS Catalina 10.15.3

[issue40024] Add PyModule_AddType helper function

2020-03-29 Thread STINNER Victor
STINNER Victor added the comment: Thanks Dong-hee Na for fixing many reference leaks! I like the new PyModule_AddType() helper function. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue40024] Add PyModule_AddType helper function

2020-03-29 Thread STINNER Victor
STINNER Victor added the comment: New changeset 016bdd519d76c282bbe0220c67a49226b6262638 by Dong-hee Na in branch 'master': bpo-40024: Update _elementtree to use PyModule_AddType() (GH-19205) https://github.com/python/cpython/commit/016bdd519d76c282bbe0220c67a49226b6262638 --

[issue40077] Convert static types to PyType_FromSpec()

2020-03-29 Thread STINNER Victor
STINNER Victor added the comment: IMO 1.01x slower on a *microbenchmark* is not significant so it's ok. Thanks for checking. You pass a *type to isinstance() in bench_isinstance_check.py. You should pass *an instance* instead. Like (complete the (...) ;-)): runner.timeit(name="bench

[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-29 Thread STINNER Victor
STINNER Victor added the comment: Wow wow wow, that's huge. Python helps to detect FreeBSD kernel bugs :-) Thanks a lot Kubilay Kocak! -- ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-03-29 Thread Dong-hee Na
Dong-hee Na added the comment: > You pass a *type to isinstance() in bench_isinstance_check.py. Thanks for the catch my mistake. The result is showing: Not significant (1): bench _abc_instancecheck -- Added file: https://bugs.python.org/file49009/bench_isinstance_check.py

[issue40094] Add os.status_to_exitcode() function

2020-03-29 Thread STINNER Victor
STINNER Victor added the comment: I modified my PR to add Windows support. On Windows, os.waitpid() status also requires an operation (shif right by 8 bits) to get an exitcode from the waitpid status. So IMO it's worth it to add it to Windows as well, which makes the function even more

[issue40093] ThreadPoolExecutor with wait=True shuts down too early

2020-03-29 Thread gaoxinge
gaoxinge added the comment: ``` from concurrent.futures import ThreadPoolExecutor from time import sleep def wait_on_future(): sleep(1) print(f.done()) # f is not done obviously f2 = executor.submit(pow, 5, 2) print(f2.result()) sleep(1) executor =

[issue40101] lib2to3 fails on default convert functionality

2020-03-29 Thread Batuhan Taskaya
New submission from Batuhan Taskaya : When using driver/parser without a custom convert function (like pyconvert.convert), it tries to assign used_names to the root node, which can be anything depending on the given convert function. If none given, it will be a tuple. >>> from

[issue40093] ThreadPoolExecutor with wait=True shuts down too early

2020-03-29 Thread gaoxinge
gaoxinge added the comment: The workflow is like below: - executor submit wait_on_future, and return the future f - executor call shutdown - executor submit pow (because executor already call shutdown, this submit will fail and raise a runtime error) - then fail above will cause work thread

[issue33725] Python crashes on macOS after fork with no exec

2020-03-29 Thread Mouse
Mouse added the comment: @mark.dickinson, the issue you referred to did not show a working sample. Could you demonstrate on my example how it should be applied? Thanks! -- ___ Python tracker

[issue40001] ignore errors in SimpleCookie

2020-03-29 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +BTaskaya nosy_count: 2.0 -> 3.0 pull_requests: +18577 pull_request: https://github.com/python/cpython/pull/19214 ___ Python tracker ___

[issue40101] lib2to3 fails on default convert functionality

2020-03-29 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- keywords: +patch pull_requests: +18578 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19214 ___ Python tracker ___

[issue40001] ignore errors in SimpleCookie

2020-03-29 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- pull_requests: -18577 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40001] ignore errors in SimpleCookie

2020-03-29 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: -BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33725] Python crashes on macOS after fork with no exec

2020-03-29 Thread Mouse
Mouse added the comment: Also, adding `p.join()` immediately after `p.start()` in my sample code showed this timing: ``` $ time python3.8 multi1.py worker 0 done, got 100 numbers worker 1 done, got 0 numbers worker 2 done, got 0 numbers worker 3 done, got 0 numbers real0m2.342s user

[issue40096] Support _Py_NO_RETURN on XLC

2020-03-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue40096] Support _Py_NO_RETURN on XLC

2020-03-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 0003c2dc1d4cf5b122e73e83177fd274fa9a9913 by Batuhan Taşkaya in branch 'master': bpo-40096: Support __attribute__((__noreturn__)) on xlc (GH-19204) https://github.com/python/cpython/commit/0003c2dc1d4cf5b122e73e83177fd274fa9a9913

[issue40090] The referenced RFC for the json module should be corrected to rfc8259

2020-03-29 Thread Ama Aje My Fren
Ama Aje My Fren added the comment: I am not the expert on this but I did a swift check of the two documents before doing the documentation PR . >From my reading of the two, RFC8259 seems that:

[issue33725] Python crashes on macOS after fork with no exec

2020-03-29 Thread Mark Dickinson
Mark Dickinson added the comment: @Mouse: replace the last block of your code with something like this: # Start worker processes workers = [] for m in range(nProcesses): p = mp.Process(target=getElements, args=(q, tSleep / 1000, m)) workers.append(p)

[issue40102] Improve XLC support for function attributes

2020-03-29 Thread Batuhan Taskaya
New submission from Batuhan Taskaya : XLC supports visibility, deprecated and aligned attributes (can be seen in this language reference https://www.ibm.com/support/pages/sites/default/files/support/swg/swgdocs.nsf/0/18b50c3c2309a37585257daf004d373e/%24FILE/langref.pdf) -- messages:

[issue33725] Python crashes on macOS after fork with no exec

2020-03-29 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23574] datetime: support leap seconds

2020-03-29 Thread STINNER Victor
STINNER Victor added the comment: One option to explore is to add a "leap seconds" field to datetime.datetime which can be negative (just in case someone decides to add negative leap seconds in the future). It can use in operations which involve time zones, it can be

[issue40108] Improve error message for -m option when .py is present

2020-03-29 Thread Raymond Hettinger
New submission from Raymond Hettinger : I think we can do better than the following: $ python3.8 -m unicode_math_symbols.py /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8: Error while finding module specification for 'unicode_math_symbols.py' (ModuleNotFoundError: __path__

[issue39950] Add pathlib.Path.hardlink_to()

2020-03-29 Thread Barney Gale
Barney Gale added the comment: A question: For my patch, I need to include a Python version where `Path.link_to()` will become unavailable. I'm not entirely sure how this should be determined. Some factors in play: - `link_to()` was added in Python 3.8 - On github, I found these three

[issue40105] Updating zip comment doesn't truncate the zip file

2020-03-29 Thread Yudi
New submission from Yudi : Updating the zip file comment to a shorter comment should truncate the zip file at the end of the new comment. Instead, the new comment is written to the zip file but the file length stays the same. For example, for a zip file that has the following zip comment:

[issue40093] ThreadPoolExecutor with wait=True shuts down too early

2020-03-29 Thread fireattack
fireattack added the comment: Here is another more bizarre showcase of the issue I come up with. If you do: ``` import concurrent.futures import time def test(): time.sleep(3) print('test') ex = concurrent.futures.ThreadPoolExecutor(max_workers=10) ex.submit(test) ``` This

[issue24132] Direct sub-classing of pathlib.Path

2020-03-29 Thread Barney Gale
Barney Gale added the comment: I'm taking another look at making `pathlib` extensible. There's some discussion here: https://discuss.python.org/t/make-pathlib-extensible/3428 List or preparatory bugfixes and tidy-ups:

[issue28965] Multiprocessing spawn/forkserver fails to pass Queues

2020-03-29 Thread Mouse
Mouse added the comment: On MacOS Catalina 10.15.4, I still see this problem occasionally even with p.join() added. See https://bugs.python.org/msg365251 and subsequent messages. Also, see https://bugs.python.org/issue40106. -- nosy: +mouse07410

[issue40102] Improve XLC support for function attributes

2020-03-29 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- keywords: +patch pull_requests: +18579 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19215 ___ Python tracker ___

[issue40102] Improve XLC support for function attributes

2020-03-29 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- assignee: -> BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40098] dir() does not return the list of valid attributes for the object

2020-03-29 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW it might be a good idea to look into how PEP 585 could benefit from the improvements to dir(). Currently, dir(list) and dir(list[int]) are quite different -- only the former shows list methods like append and insert. See

[issue40104] ElementTree does not find elements in a default namespace with namespaces

2020-03-29 Thread Myron Walker
New submission from Myron Walker : When you have an xml document like the one with a default namespace below. When you try to lookup nodes in the document they are not found. ``` docTree.find("specVersion") None ``` If you add a namespaces map with the '' key and the default namespaces

[issue37973] improve docstrings of sys.float_info

2020-03-29 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch nosy: +ZackerySpytz nosy_count: 4.0 -> 5.0 pull_requests: +18580 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19218 ___ Python tracker

[issue40084] HTTPStatus has incomplete dir() listing

2020-03-29 Thread Angelin BOOZ
Change by Angelin BOOZ : -- keywords: +patch nosy: +lem nosy_count: 4.0 -> 5.0 pull_requests: +18581 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19219 ___ Python tracker

[issue33725] Python crashes on macOS after fork with no exec

2020-03-29 Thread Mouse
Mouse added the comment: @mark.dickinson, thank you. Following your suggestion, I've added a comment in #28965, and created a new issue https://bugs.python.org/issue40106. -- nosy: +vstinner ___ Python tracker

[issue36144] Dictionary union. (PEP 584)

2020-03-29 Thread Curtis Bucher
Change by Curtis Bucher : -- pull_requests: +18583 pull_request: https://github.com/python/cpython/pull/19221 ___ Python tracker ___

[issue40107] pathlib: make `_Accessor.open()` return a file object and not a file descriptor

2020-03-29 Thread Barney Gale
New submission from Barney Gale : This is one of a series of bug reports / PRs that lay the groundwork for making pathlib extensible. See here for detail: https://discuss.python.org/t/make-pathlib-extensible/3428 Currently `_Accessor.open()` is expected to function like `os.open()` and

[issue33725] Python crashes on macOS after fork with no exec

2020-03-29 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40098] dir() does not return the list of valid attributes for the object

2020-03-29 Thread Guido van Rossum
Guido van Rossum added the comment: I think you're going too far for some of these. > 1. metaclasses This is reasonable. > 2. __mro__ This is also reasonable. (I wonder if that part of the dir() implementation predates __mro__?) I'm not sure about honoring mro() in the metaclass, but it

[issue40104] ElementTree does not find elements in a default namespace with namespaces

2020-03-29 Thread Myron Walker
Myron Walker added the comment: Looks like this is fixed in the latest source code. -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue38337] inspect: getmembers calls properties

2020-03-29 Thread Jonas Drotleff
Jonas Drotleff added the comment: I'm still thinking about this bug/issue/undefined behaviour. Today I wanted to test its behaviour with async: import inspect class Foo: def __init__(self, bar): self._bar = bar @property async def spam(self): print('Called

[issue40106] multiprocessor spawn

2020-03-29 Thread Mouse
New submission from Mouse : MacOS Catalina 10.15.3 and 10.15.4. Python-3.8.2 (also tested with 3.7.7, which confirmed the problem being in the fix described in https://bugs.python.org/issue33725. Trying to use "multiprocessor" with Python-3.8 and with the new default of

[issue39073] email incorrect handling of crlf in Address objects.

2020-03-29 Thread R. David Murray
R. David Murray added the comment: New changeset 614f17211c5fc0e5b828be1d3320661d1038fe8f by Ashwin Ramaswami in branch 'master': bpo-39073: validate Address parts to disallow CRLF (#19007) https://github.com/python/cpython/commit/614f17211c5fc0e5b828be1d3320661d1038fe8f --

[issue39073] email incorrect handling of crlf in Address objects.

2020-03-29 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +18584 pull_request: https://github.com/python/cpython/pull/19222 ___ Python tracker

[issue39089] Update IDLE's credits

2020-03-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I have thought about everything from deleting the file to a detailed update. If we keep it, anything would be an improvement. Perhap something in the middle, starting in 2013. I just decided I don't need be be responsible for anything earlier, even this I

[issue37614] Pasteing into idle makes it exit

2020-03-29 Thread Terry J. Reedy
Change by Terry J. Reedy : -- title: Pasteing into idle makes it crash -> Pasteing into idle makes it exit ___ Python tracker ___

[issue40109] List index doesn't work with multiple assignment

2020-03-29 Thread Nathan Brooks
New submission from Nathan Brooks : Faulty example: x = [1,2,3,4,5,6,7] # this should replace items 3 and 6 with each other x[2], x[x.index(6)] = 6, x[2] print(x) [1,2,3,4,5,6,7] Workaround: x = [1,2,3,4,5,6,7] i = x.index(6) # this replaces items 3 and 6 in the list. x[2], x[i] = 6, x[2]

[issue39951] Ignore specific errors when closing ssl connections

2020-03-29 Thread Dima Tisnek
Dima Tisnek added the comment: Sorry I was too fast to close this. 39953 is about error codes. This bug is about having an error at all. I believe that the code in question should pass without error, even in the presence of network delays. -- resolution: duplicate -> status:

[issue40111] Introspect ssl context: read ALPN and NPN protocols

2020-03-29 Thread Dima Tisnek
New submission from Dima Tisnek : It's quite easy to create new or modify existing ssl context: ssl_context = ssl.create_default_context() ssl_context.set_alpn_protocols(["h2"]) I'm writing a library where the context may be passed by the caller (useful if the caller wants to set custom CA

[issue40103] ZipFile.extractall is not multiprocess safe with regard to directory creation.

2020-03-29 Thread Nathan Silberman
New submission from Nathan Silberman : When extracting multiple zip files, each from a separate process, if the files being extracted are in nested directories and files across zips contain the same parent directories, the extraction process fails as one zip attempts to create a directory

[issue40093] ThreadPoolExecutor with wait=True shuts down too early

2020-03-29 Thread fireattack
fireattack added the comment: Hi gaoxinge, thanks for the reply. I assume what you mean is that while shutdown will wait, it won't accept any new job/future after it is called. That makes sense, but this still doesn't work: ``` from concurrent.futures import ThreadPoolExecutor from time

[issue40094] Add os.status_to_exitcode() function

2020-03-29 Thread STINNER Victor
STINNER Victor added the comment: Interesting information about process "exit status code": https://en.wikipedia.org/wiki/Exit_status -- ___ Python tracker ___

[issue40094] Add os.status_to_exitcode() function

2020-03-29 Thread STINNER Victor
STINNER Victor added the comment: The function can be used to convert the result of the following functions: * os.system() (on Unix) * os.wait() * os.waitpid() * os.wait3() * os.wait4() * pty.spawn() Note: waitid() has a different API, si_status can be used directly, its meaning depends on

[issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently

2020-03-29 Thread Barney Gale
Change by Barney Gale : -- pull_requests: +18582 pull_request: https://github.com/python/cpython/pull/19220 ___ Python tracker ___

[issue39073] email incorrect handling of crlf in Address objects.

2020-03-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +18585 pull_request: https://github.com/python/cpython/pull/19223 ___ Python tracker ___

[issue39073] email incorrect handling of crlf in Address objects.

2020-03-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +18586 pull_request: https://github.com/python/cpython/pull/19224 ___ Python tracker ___

[issue39073] email incorrect handling of crlf in Address objects.

2020-03-29 Thread R. David Murray
R. David Murray added the comment: Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39073] email incorrect handling of crlf in Address objects.

2020-03-29 Thread R. David Murray
Change by R. David Murray : -- stage: patch review -> backport needed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-29 Thread Kubilay Kocak
Kubilay Kocak added the comment: +1 to mutually beneficial relationships :) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue40018] test_ssl fails with OpenSSL 1.1.1e

2020-03-29 Thread Kubilay Kocak
Kubilay Kocak added the comment: Confirming: test_ssl passes with 1.1.1e + reverted EOF change -- ___ Python tracker ___ ___

[issue39207] concurrent.futures.ProcessPoolExecutor does not properly reap jobs and spawns too many workers

2020-03-29 Thread Kyle Stanley
Kyle Stanley added the comment: So, I think a potential approach to this issue with ProcessPoolExecutor would be making it a bit more similar to ThreadPoolExecutor: instead of spawning *max_workers* processes on startup (see `_adjust_process_count()`), spawn each new process in submit()

[issue39951] Ignore specific errors when closing ssl connections

2020-03-29 Thread Dima Tisnek
Dima Tisnek added the comment: Let's close this in favour of https://bugs.python.org/issue39953 which has a pending pull request https://github.com/python/cpython/pull/19082 -- resolution: -> duplicate stage: -> resolved status: open -> closed

[issue40110] multiprocessing.Pool.imap() should be lazy

2020-03-29 Thread Nick Guenther
New submission from Nick Guenther : multiprocessing.Pool.imap() is supposed to be a lazy version of map. But it's not: it submits work to its workers eagerly. As a consequence, in a pipeline, all the work from earlier steps is queued, performed, and finished first, before starting later

[issue40093] ThreadPoolExecutor with wait=True shuts down too early

2020-03-29 Thread gaoxinge
gaoxinge added the comment: > I assume what you mean is that while shutdown will wait, it won't accept any > new job/future after it is called. Yes, you are right. This is a feature of the ThreadPoolExecutor. -- ___ Python tracker

[issue40109] List index doesn't work with multiple assignment

2020-03-29 Thread Benjamin Peterson
Benjamin Peterson added the comment: Python doesn't have multiple assignment, just tuple unpacking. Consider the order of evaluation here: 1. tmp = (6, x[2]) (i.e., (6, 2)) 2. x[2] = tmp[0] 3. tmp2 = x.index(6) (= 2) 4. x[tmp2] = tmp[1] (i.e., x[2] = 2) -- nosy: +benjamin.peterson

[issue40018] test_ssl fails with OpenSSL 1.1.1e

2020-03-29 Thread Kubilay Kocak
Kubilay Kocak added the comment: Updating the koobs-freebsd-564d buildbots FreBSD openssl port now which has had the 1.1.1e EOF change reverted. Will run the last 3.x build again and report here whether it passes (it should) or not. -- ___ Python

[issue33725] Python crashes on macOS after fork with no exec

2020-03-29 Thread Mark Dickinson
Mark Dickinson added the comment: @Mouse: see #28965. The fix for the code you show is to join the child processes before the main process starts exiting. -- nosy: +mark.dickinson ___ Python tracker