[issue40413] Py_RunMain() crashes on subsequence call

2020-04-27 Thread Gregory Szorc
New submission from Gregory Szorc : I'm attempting to perform the following actions multiple times in a single process with CPython 3.8.2: 1) Initialize an interpreter using the PEP-587 APIs. 2) Call Py_RunMain() (which finalizes the interpreter). However, I've encountered at least 2 crashes

[issue40413] Py_RunMain() crashes on subsequence call

2020-04-27 Thread Gregory Szorc
Gregory Szorc added the comment: Actually, I can reproduce the crash without Py_RunMain(). So I don't think the crash is related to the additional cleanup that Py_RunMain() does in addition to Py_FinalizeEx(). But I'd like to keep this issue open to track the original question about expecte

[issue40414] Incorrect mouse and keyboard mapping

2020-04-27 Thread Jah-On
New submission from Jah-On : Hi all, On Ubuntu Cinnamon Remix, with python3, and tkinter, canvas.bind("<1>", callback) canvas.bind("<2>", callback) canvas.bind("<3>", callback) canvas.bind("<4>", callback) canvas.bind("<5>", callback) are now mapped to mouse buttons, instead of keyboard number

[issue40411] frozen collection.Counter

2020-04-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Do you want to freeze a counter to prevent future count changes or bto make it to be hashable? Essentially the only reason we have frozenset is to use sets as dict keys to model graphs, but that wouldn't make much sense for counters. What multiset method

[issue40415] _asyncio extensions crashes if initialized multiple times in same process

2020-04-27 Thread Gregory Szorc
New submission from Gregory Szorc : Most of CPython's extensions can be initialized and freed multiple times in the same process. However, _asyncio crashes on at least CPython 3.8.2 when this is done. STR: 1. Create a new Python interpreter 2. Have it import _asyncio 3. Finalize that interpr

[issue40415] _asyncio extensions crashes if initialized multiple times in same process

2020-04-27 Thread Gregory Szorc
Change by Gregory Szorc : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue40415] _asyncio extensions crashes if initialized multiple times in same process

2020-04-27 Thread Gregory Szorc
Gregory Szorc added the comment: Oh, I just went to patch this and it is a dupe of 40294, which has already been fixed and backported. -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker

[issue40405] asyncio.as_completed documentation misleading

2020-04-27 Thread Yury Selivanov
Yury Selivanov added the comment: > @Yury what do you think? Yeah, the documentation needs to be fixed. > Maybe "Returns an iterator of awaitables"? I'd suggest to change to: "Return an iterator of coroutines. Each coroutine allows to wait for the earliest next result from the set of the r

[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-04-27 Thread Kyle Stanley
Kyle Stanley added the comment: I can't be certain for the other failures, but I'm currently exploring a potential solution for addressing the `test_killed_child` failure. To me, it seems to be a race condition with attempting to call _ThreadWakeup.close() while there are still bytes being s

[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-04-27 Thread Kyle Stanley
Kyle Stanley added the comment: After writing the above out and a bit of further consideration, I think it might make more sense to wait for the event after setting `self._closed = True` so that it prevents future wakeup() and clear() calls from reading/writing to the pipe, while still allow

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Yes, the idea was for them to be hashable, to be used as dict keys. E.g. if you use frozensets to model graphs, you'd use frozen multisets for hypergraphs. My immediate use case involved word puzzles, e.g. treating words as bags of scrabble tiles with letters

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Kyle, thanks, I saw your comment after posting my own, and I looked at Raymond's mailing list post that you linked. I do think that "completing the grid" is a good thing in the cases where it's obvious how to do it (if there's one and one obvious way, then doin

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-27 Thread Domenico Ragusa
Domenico Ragusa added the comment: Yeah, you're right, there's no access to the filesystem and the result is generated assuming the paths are already resolved. `strict` seems to be an appropriate name for the option, thanks. I've looked into the test suite, it helped a lot especially with Windo

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-27 Thread Domenico Ragusa
Change by Domenico Ragusa : Removed file: https://bugs.python.org/file49081/pathlib.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Oops I meant "*without* 100s of third party modules" in the case of ruby gems or npm. There are just a few pip modules that I really use all the time, most notably bs4. I continue to use urllib/urllib2 instead of requests because I'm used to them and because t

[issue40411] frozen collection.Counter

2020-04-27 Thread Vedran Čačić
Vedran Čačić added the comment: Just another usecase: one of my students is writing an implementation of ordinal arithmetic in Python as a graduate thesis. FrozenCounters whose keys are FrozenCounters and whose values are natural numbers are _exactly_ isomorphic (via Cantor's normal form) to

[issue40359] email.parse part.get_filename() fails to unwrap long attachment file names (legacy API)

2020-04-27 Thread Matthew Davis
Matthew Davis added the comment: Ah, yes that workaround works. Thanks! So what's the exact status of this policy? It's called the default policy, but it's not used by default? If I download the latest version of python, will this be parsed correctly without explicitly setting the policy?

[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-04-27 Thread Rob Malouf
New submission from Rob Malouf : Calling TextIOWrapper.tell() while reading the attached gb2312-encoded file like this: with open('udhr-gb2312.txt', encoding='GB2312') as f: while True: line = f.readline() t = f.tell() if not line: break gives this res

[issue40411] frozen collection.Counter

2020-04-27 Thread Kyle Stanley
Kyle Stanley added the comment: paul rubin wrote: > In that case, it works for what it is made for, so it really then is a > separate question of whether implementing multisets properly is worthwhile. Indeed, that seems to be the primary question to address. Personally, I don't have any stro

[issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child

2020-04-27 Thread hai shi
hai shi added the comment: > "since we are going to delete the threading.Thread object with its > _tstate_lock object anyway" sentence is a description of the current > _PyThreadState_DeleteExcept() implementation. Oh, got it. thanks for your explanation :) -- _

[issue40411] frozen collection.Counter

2020-04-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: If you're interested in pursuing this, please follow Kyle's suggestion and move this to Python ideas. The two frozencounter use cases presented are pretty exotic, something encountered rarely in a lifetime. That is well below the threshold for growing t

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Yeah I think the basic answer to this ticket is "Python doesn't really have multisets and a proposal to add them should go somewhere else". Fair enough-- consider the request withdrawn from here. Regarding minimalism vs completeness, regarding some feature X (s

[issue40061] Possible refleak in _asynciomodule.c future_add_done_callback()

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

[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2020-04-27 Thread BenTen Jan
BenTen Jan added the comment: First and foremost thanks for replying, 1. I don't have any virus scanner installed. 2. I have tried running "python -m ensurepip" it shows me Following error C:\Python>Python get-pip.py Traceback (most recent call last): File "get-pip.py", line 22711, in

[issue40411] frozen collection.Counter

2020-04-27 Thread paul rubin
paul rubin added the comment: Totally tangential: Veky, your ordinal example would work ok in Haskell and you'd have omega work the same way as epsilon0. Take a look at Herman Ruge Jervell's book "Proof Theory" for a really nice tree-based ordinal notation that goes much higher than epsilon

[issue40417] PyImport_ReloadModule emits deprecation warning

2020-04-27 Thread Robert Rouhani
New submission from Robert Rouhani : It appears as though PyImport_ReloadModule is importing the deprecated "imp" module. I integrated a newer version of Python into Unreal Engine 4, which internally calls this function for some of it's own modules. Normally a stray warning wouldn't be of mu

[issue40418] Small Refactoring: Use the bytes.hex() in secrets.token_hex()

2020-04-27 Thread Dennis Sweeney
New submission from Dennis Sweeney : Since bytes.hex() was added in 3.5, we should be able to make the following change: diff --git a/Lib/secrets.py b/Lib/secrets.py index a546efbdd4..1dd8629f52 100644 --- a/Lib/secrets.py +++ b/Lib/secrets.py @@ -13,7 +13,6 @@ __all__ = ['

[issue40418] Small Refactoring: Use the bytes.hex() in secrets.token_hex()

2020-04-27 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +19070 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19749 ___ Python tracker ___ _

[issue40418] Small Refactoring: Use bytes.hex() in secrets.token_hex()

2020-04-27 Thread Dennis Sweeney
Change by Dennis Sweeney : -- title: Small Refactoring: Use the bytes.hex() in secrets.token_hex() -> Small Refactoring: Use bytes.hex() in secrets.token_hex() ___ Python tracker

<    1   2