[issue38853] set.repr breaches docstring contract

2019-11-20 Thread Cat Chenal
Cat Chenal added the comment: Thank you for pointing out my lack of clarity: I apologize. I probably should not have split this issue in two (issue38855). My confusion stems from the fact that I expected the unpacking of a set to return the same output as that obtained from the unpacking of

[issue38841] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

2019-11-20 Thread Xavier de Gaye
Change by Xavier de Gaye : -- keywords: +patch pull_requests: +16787 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/17294 ___ Python tracker

[issue38864] dbm: Can't open database with bytes-encoded filename

2019-11-20 Thread John Goerzen
New submission from John Goerzen : This simple recipe fails: >>> import dbm >>> dbm.open(b"foo") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.7/dbm/__init__.py", line 78, in open result = whichdb(file) if 'n' not in flag else None File

[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-20 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +16786 pull_request: https://github.com/python/cpython/pull/17293 ___ Python tracker ___

Re: Any socket library to communicate with kernel via netlink?

2019-11-20 Thread Ian Pilcher
On 11/18/19 9:23 PM, lampahome wrote: As title, I tried to communicate with kernel via netlink. But I failed when I receive msg from kernel. The weird point is sending successfully from user to kernel, failed when receiving from kernel. So I want to check code in 3rd library and dig in, but

[issue38863] http.server is_cgi() does not correctly separate dir

2019-11-20 Thread Siwon Kang
Change by Siwon Kang : -- keywords: +patch pull_requests: +16785 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17292 ___ Python tracker ___

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-20 Thread Jackson Riley
Change by Jackson Riley : -- keywords: +patch pull_requests: +16784 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17291 ___ Python tracker ___

[issue38692] add a pidfd child process watcher

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: As I already proposed previously, I proposed PR 17290 to simply skip test_pidfd_open() if os.pidfd_open() fails with a PermissionError. I don't propose to change os.pidfd_open(), only the test unit for practical reasons: not bother users who have to use a

[issue38692] add a pidfd child process watcher

2019-11-20 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +16783 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/17290 ___ Python tracker ___

[issue38692] add a pidfd child process watcher

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: I reopen the issue since the discussion restarted. -- status: closed -> open ___ Python tracker ___

[issue22107] tempfile module misinterprets access denied error on Windows

2019-11-20 Thread Erik Aronesty
Erik Aronesty added the comment: This is the fist of what I'm using: https://gist.github.com/earonesty/a052ce176e99d5a659472d0dab6ea361 Seems OK for my use cases. There's probably issues with relying on __del__ this way. But it solves the Windows close/reopen problem, too. --

[issue38863] http.server is_cgi() does not correctly separate dir

2019-11-20 Thread Siwon Kang
New submission from Siwon Kang : is_cgi() in CGIHTTPRequestHandler class separates given path into (dir, rest) then checks if dir is in cgi_directories. However, it divides based on the first seen '/', multi-level directories like /sub/dir/cgi-bin/hello.py is divided into head=/sub,

[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2019-11-20 Thread Justin Capella
Justin Capella added the comment: Can't see the specifics of that "restricted" redhat bug, but this was interesting bug and I wanted to ask if perhaps the domain in such cases should be IDN / punycoded ://xn--n28h.ws/ for example is ://.la -- nosy: +b1tninja

[issue38821] argparse calls ngettext with deprecated non-integer value

2019-11-20 Thread miss-islington
miss-islington added the comment: New changeset 836f137f7ae0799de937e5281cb1da2bfdb8a69d by Miss Islington (bot) in branch '3.8': bpo-38821: Fix crash in argparse when using gettext (GH-17192) https://github.com/python/cpython/commit/836f137f7ae0799de937e5281cb1da2bfdb8a69d --

[issue38821] argparse calls ngettext with deprecated non-integer value

2019-11-20 Thread miss-islington
miss-islington added the comment: New changeset ecb2afc1bc1c2f3f9f99b09dd866100c3c7dcab7 by Miss Islington (bot) in branch '3.7': bpo-38821: Fix crash in argparse when using gettext (GH-17192) https://github.com/python/cpython/commit/ecb2afc1bc1c2f3f9f99b09dd866100c3c7dcab7 --

[issue38821] argparse calls ngettext with deprecated non-integer value

2019-11-20 Thread Tal Einat
Change by Tal Einat : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7 ___ Python tracker ___

[issue38821] argparse calls ngettext with deprecated non-integer value

2019-11-20 Thread Tal Einat
Tal Einat added the comment: Thanks for the report and the PR with a fix, Federico! As discussed on in the PR comments, the PR did not include tests since there are currently no tests for argparse i18n. Please create a new issue for that, referencing this one. --

[issue38821] argparse calls ngettext with deprecated non-integer value

2019-11-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +16782 pull_request: https://github.com/python/cpython/pull/17289 ___ Python tracker ___

[issue38821] argparse calls ngettext with deprecated non-integer value

2019-11-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +16781 pull_request: https://github.com/python/cpython/pull/17288 ___ Python tracker ___

[issue38821] argparse calls ngettext with deprecated non-integer value

2019-11-20 Thread Tal Einat
Tal Einat added the comment: New changeset be5c79e0338005d675a64ba6e5b137e850d556d1 by Tal Einat (Federico Bond) in branch 'master': bpo-38821: Fix crash in argparse when using gettext (GH-17192) https://github.com/python/cpython/commit/be5c79e0338005d675a64ba6e5b137e850d556d1 --

[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: (previous message deleted, I hadn't noticed the "reuse_port" parameter) My preference for create_datagram_endpoint() would be: - make the "reuse_address" parameter a no-op, and raise an error when "reuse_address=True" is passed - do that in 3.8 as well

[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-20 Thread Antoine Pitrou
Change by Antoine Pitrou : -- Removed message: https://bugs.python.org/msg357067 ___ Python tracker ___ ___ Python-bugs-list

[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is another suggestion: - make the "reuse_address" parameter a no-op, and raise an error when "reuse_address=True" is passed - add a new "allow_multiple_bind=False" parameter that enables SO_REUSEPORT - do that in 3.8 as well This way we 1) solve the

[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-20 Thread Jukka Väisänen
Jukka Väisänen added the comment: Going to SO_REUSEPORT will fix the security issue and emitting a deprecation warning for default value invocation will catch the eyes of some maintainers but it will not prevent what caused me to catch this issue in the first place - starting two processes

[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2019-11-20 Thread kim
Change by kim : -- nosy: +kim ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37340] remove free_list for bound method objects

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4dedd0f0ddc5a983a57bf0105eb34f948a91d2c4 by Victor Stinner in branch 'master': bpo-37340: Remove PyMethod_ClearFreeList() and PyCFunction_ClearFreeList() (GH-17284)

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2019-11-20 Thread Jan Hutař
Jan Hutař added the comment: I think there is a same issue with "nargs='+'" - if you are aware of the, please ignore me. $ python3 --version Python 3.7.5 With "choices=...", there seems to be a problem: $ cat bbb.py #!/usr/bin/env python3 import argparse parser =

[issue24554] GC should happen when a subinterpreter is destroyed

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: bpo-36854 has been fixed, so it's time to reconsider fixing this issue :-) -- nosy: +vstinner ___ Python tracker ___

[issue36854] GC operates out of global runtime state.

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: It's now done in the future Python 3.9! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.8 ___ Python tracker

[issue36854] GC operates out of global runtime state.

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7247407c35330f3f6292f1d40606b7ba6afd5700 by Victor Stinner in branch 'master': bpo-36854: Move _PyRuntimeState.gc to PyInterpreterState (GH-17287) https://github.com/python/cpython/commit/7247407c35330f3f6292f1d40606b7ba6afd5700 --

[issue38835] pyfpe.h: Exclude PyFPE_START_PROTECT and PyFPE_END_PROTECT from the Py_LIMITED_API

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: Pablo asked on PR 17231: > Do you want to left the empty macro in Include/pyfpe.h? https://github.com/python/cpython/pull/17231#pullrequestreview-319366200 I replied: > If someone wants to remove them, I would suggest to first deprecate them, and > wait at

[issue38835] pyfpe.h: Exclude PyFPE_START_PROTECT and PyFPE_END_PROTECT from the Py_LIMITED_API

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset 488d02a24142948bfb1fafd19fa48e61fcbbabc5 by Victor Stinner in branch 'master': bpo-38835: Exclude PyFPE macros from the stable API (GH-17228) https://github.com/python/cpython/commit/488d02a24142948bfb1fafd19fa48e61fcbbabc5 --

[issue38692] add a pidfd child process watcher

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: > BTW my kernel is: 5.3.7-301.fc31.x86_64 I get a different error on Fedora 31 with Linux kernel 5.3.9-300.fc31.x86_64: $ ./python Python 3.9.0a1+ (heads/method_freelist:e34fa9b8d7, Nov 20 2019, 12:09:54) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux >>>

[issue38692] add a pidfd child process watcher

2019-11-20 Thread Nathaniel Smith
Nathaniel Smith added the comment: I don't know about podman, but it sounds like mock and docker both use buggy sandboxing: https://bugzilla.redhat.com/show_bug.cgi?id=1770154 -- ___ Python tracker

[issue38692] add a pidfd child process watcher

2019-11-20 Thread Miro Hrončok
Miro Hrončok added the comment: BTW my kernel is: 5.3.7-301.fc31.x86_64 Sorry for commenting twice, I forgot to mention that. -- ___ Python tracker ___

[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset e7e699e4df73420ddccaa0057cd07ebb3b590b9b by Victor Stinner in branch 'master': bpo-38858: Fix reference leak in pycore_init_types() (GH-17286) https://github.com/python/cpython/commit/e7e699e4df73420ddccaa0057cd07ebb3b590b9b --

[issue38692] add a pidfd child process watcher

2019-11-20 Thread Miro Hrončok
Miro Hrončok added the comment: I have consistent behavior on Fedora 32 in mock [0] and podman [1]. Wanted to test docker as well, but my docker setup is currently broken. # python3.9 Python 3.9.0a1 (default, Nov 20 2019, 00:00:00) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux Type "help",

[issue36854] GC operates out of global runtime state.

2019-11-20 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +16780 pull_request: https://github.com/python/cpython/pull/17287 ___ Python tracker ___

Use epoll but still lose packet

2019-11-20 Thread lampahome
I use epoll to listen events to receive packet from remote client via tcp socket And I found it still lose packet from remote client when client sends 128 messages to me. Is there any tips to avoid this? thx I only use a while loop to catch events like below: import select, socket sock =

[issue36854] GC operates out of global runtime state.

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset 67e0de6f0b060ac8f373952f0ca4b3117ad5b611 by Victor Stinner in branch 'master': bpo-36854: gcmodule.c gets its state from tstate (GH-17285) https://github.com/python/cpython/commit/67e0de6f0b060ac8f373952f0ca4b3117ad5b611 --

[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: > New changeset ef5aa9af7c7e493402ac62009e4400aed7c3d54e by Victor Stinner in > branch 'master': > bpo-38858: Reorganize pycore_init_types() (GH-17265) This change introduced a reference leak: https://buildbot.python.org/all/#builders/80/builds/771

[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-20 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +16779 pull_request: https://github.com/python/cpython/pull/17286 ___ Python tracker ___

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread miss-islington
miss-islington added the comment: New changeset 1d7245c3e0cfe4508855c5025b25d8894155ecc5 by Miss Islington (bot) in branch '3.7': bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235) https://github.com/python/cpython/commit/1d7245c3e0cfe4508855c5025b25d8894155ecc5

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread miss-islington
miss-islington added the comment: New changeset daf7a082b20e59a0518cda1500add42c36ab058f by Miss Islington (bot) in branch '3.8': bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235) https://github.com/python/cpython/commit/daf7a082b20e59a0518cda1500add42c36ab058f

[issue36854] GC operates out of global runtime state.

2019-11-20 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +16778 pull_request: https://github.com/python/cpython/pull/17285 ___ Python tracker ___

[issue36854] GC operates out of global runtime state.

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset 9da7430675ceaeae5abeb9c9f7cd552b71b3a93a by Victor Stinner in branch 'master': bpo-36854: Clear the current thread later (GH-17279) https://github.com/python/cpython/commit/9da7430675ceaeae5abeb9c9f7cd552b71b3a93a -- nosy: +vstinner

[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-20 Thread Kyle Stanley
Kyle Stanley added the comment: > I think you can use SO_REUSEPORT instead, and for UDP sockets it's identical > to SO_REUSEADDR except with the same-UID restriction added? > If that's right then it might make sense to unconditionally switch > SO_REUSEADDR -> SO_REUSEPORT, even in existing

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread miss-islington
miss-islington added the comment: New changeset 2ea4c37c1ecf05a8495211d55ed6888439b1b9cf by Miss Islington (bot) in branch '3.8': bpo-38823: Fix refleak in marshal init error path (GH-17260) https://github.com/python/cpython/commit/2ea4c37c1ecf05a8495211d55ed6888439b1b9cf --

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread miss-islington
miss-islington added the comment: New changeset 63f09e7628bd72f1bb2106226655b1f775757806 by Miss Islington (bot) in branch '3.7': bpo-38823: Fix refleak in marshal init error path (GH-17260) https://github.com/python/cpython/commit/63f09e7628bd72f1bb2106226655b1f775757806 --

[issue37340] remove free_list for bound method objects

2019-11-20 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +16777 pull_request: https://github.com/python/cpython/pull/17284 ___ Python tracker ___

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-20 Thread Jackson Riley
Jackson Riley added the comment: Ah thank you Vedran, that makes sense. In that case, I think I'll make a start on implementing Serhiy's second suggestion - returning a pair of MagicMock instances when MagicMock.__divmod__ is called. -- ___

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +16775 pull_request: https://github.com/python/cpython/pull/17282 ___ Python tracker ___

Re: Writing a CPython extension - calling another sibbling method ?

2019-11-20 Thread R.Wieser
Dennis, > So... extract the original args, then build a new args object with your > added argument, then call your new function with that... I wanted to respond that prepending a string to an existing argument sounds quite a bit easier than what you are describing, but than I realized that I

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset d51a363a4379385fdfe9c09a56324631465ede29 by Victor Stinner (Brandt Bucher) in branch 'master': bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +16776 pull_request: https://github.com/python/cpython/pull/17283 ___ Python tracker ___

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +16774 pull_request: https://github.com/python/cpython/pull/17281 ___ Python tracker ___

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +16773 pull_request: https://github.com/python/cpython/pull/17280 ___ Python tracker ___

[issue36854] GC operates out of global runtime state.

2019-11-20 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +16772 pull_request: https://github.com/python/cpython/pull/17279 ___ Python tracker ___

[issue38858] new_interpreter() should reuse more Py_InitializeFromConfig() code

2019-11-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7eee5beaf87be898a679278c480e8dd0df76d351 by Victor Stinner in branch 'master': bpo-38858: Factorize Py_EndInterpreter() code (GH-17273) https://github.com/python/cpython/commit/7eee5beaf87be898a679278c480e8dd0df76d351 --

[issue17306] Improve the way abstract base classes are shown in help()

2019-11-20 Thread Jackson Riley
Change by Jackson Riley : -- pull_requests: +16771 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17278 ___ Python tracker ___

[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-20 Thread Nathaniel Smith
Nathaniel Smith added the comment: > Now your updated docs and warning read more like we are working around a > Linux security bug which is not really the case - this behavior was > intentionally added to the kernels and some of the code I do for a living > relies on it to work properly.

[issue37367] octal escapes applied inconsistently throughout the interpreter and lib

2019-11-20 Thread Tal Einat
Tal Einat added the comment: Alright, so let's push through the existing PR for rejecting such octal escapes in byte strings. We'll also need another PR for raising a deprecation warning for such octal escapes in strings. -- keywords: +easy, easy (C)

Re: Writing a CPython extension - calling another sibbling method ?

2019-11-20 Thread R.Wieser
Michael, > If you mentioned RPi.GPIO before, I apologize for my mistake. No I didn't, there is nothing to apologize for. > That's very helpful to know. I have no clue to why it would be, as my question has got *zero* to do with it - its valid for /any/ extension using the CPython C API.

Re: Pickle failed __getstate__ on my customized class inherited dict

2019-11-20 Thread Peter Otten
lampahome wrote: > I make a class Wrapper inherited from dict and met problem when I want to > pickle it. > > Is there anyway to make __getstate__ of Wrapper to output a normal > dict?(Output a dict will help pickleing easily) > > > === code === > import pickle > class Wrapper(dict): > def

[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-20 Thread Jukka Väisänen
Jukka Väisänen added the comment: David, in terms of documentation changes and the emitted deprecation warning itself, I think it would be appropriate to instruct that please set the parameter explicitly to True or False to silence the warning AND point out that setting it to True has

[issue38698] While parsing email message id: UnboundLocalError

2019-11-20 Thread PCManticore
Change by PCManticore : -- keywords: +patch pull_requests: +16770 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17277 ___ Python tracker ___

[issue36041] email: folding of quoted string in display_name violates RFC

2019-11-20 Thread Ronald Evers
Change by Ronald Evers : -- nosy: +ronaldevers ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-20 Thread David Cuthbert
David Cuthbert added the comment: Alright -- my first stab at the DeprecationWarning in 3.6. https://github.com/dacut/cpython/commit/6a1e261678975e2c70ec6b5e98e8affa28702312 Please critique away, and don't fret about bruising my ego. :-) Is there a more idiomatic way of getting a warning to

Re: Writing a CPython extension - calling another sibbling method ?

2019-11-20 Thread R.Wieser
Luciano, > Now that's a novel approach to asking for free help: pretending > to be smarter than the people who are trying to help you. What makes you think I'm /pretending/ ?*Ofcourse* I'm smarter than anyone on this earth, didn't you know ? :-D But I'll let you in on a secret: I'm rather

[issue38843] Document argparse behaviour when custom namespace object already has the field set

2019-11-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Ivan, you don't need to specify default values to have typing. This will suffice: class CliArgs(object): foo: Optional[str] bar: int baz: float -- ___ Python tracker

[issue38843] Document argparse behaviour when custom namespace object already has the field set

2019-11-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: For now, we should at least document that, "If the preexisting namespace has an attribute set, the action default will not over write it." -- ___ Python tracker

[issue38855] test_unpack.py does not catch the unpacking of a set

2019-11-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm also unclear on what you're looking for. Unpacking is documented to allow any iterable. This includes all kinds of potentially weird but potentially useful cases including unordered collections, strings, files, etc. These behaviors are unlikely to

[issue38823] Improve stdlib module initialization error handling.

2019-11-20 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +16769 pull_request: https://github.com/python/cpython/pull/17276 ___ Python tracker ___

<    1   2