[issue36779] time.tzname returns empty string on Windows if default codepage is a Unicode codepage

2019-05-03 Thread SilentGhost
Change by SilentGhost : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware stage: -> test needed type: -> behavior versions: +Python 3.7, Python 3.8 ___ Python tracker ___

[issue35070] test_posix fails on macOS 10.14 Mojave

2019-05-03 Thread Dave Page
Dave Page added the comment: The submitted patch from websurfer5 resolves the issue for me. -- ___ Python tracker ___ ___ Python-bu

[issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error

2019-05-03 Thread wkoot
Change by wkoot : -- nosy: +wkoot ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mai

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-03 Thread Eric V. Smith
Eric V. Smith added the comment: The most recent version of the patch implements the conditional repr/format behavior. I'm pretty happy with it. Other than docs, I think this is done. I'm going to discuss it with a few more people at PyCon, then commit it. There's a slight optimization I'm

[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-03 Thread Hrvoje Nikšić
New submission from Hrvoje Nikšić : At interpreter shutdown, Python waits for all pending futures of all executors to finish. There seems to be no way to disable the wait for pools that have been explicitly shut down with pool.shutdown(wait=False). The attached script demonstrates the issue.

[issue36781] Optimize sum() for bools

2019-05-03 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : To count the number of items that satisfy certain condition you can use either sum(1 for x in data if pred(x)) or sum(pred(x) for x in data) where pred(x) is a boolean expression. The latter case is shorter but slower. There are two causes for

[issue36780] Interpreter exit blocks waiting for futures of shut-down ThreadPoolExecutors

2019-05-03 Thread SilentGhost
Change by SilentGhost : -- nosy: +bquinlan, pitrou type: -> behavior versions: -Python 3.9 ___ Python tracker ___ ___ Python-bugs-

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This conversion is very special. For all other conversions {value:!c:format_spec} is equivalent to format(conv(value), format_spec), but not this conversion. It is also specific for f-strings, and is not particularly useful in format strings. Would not be

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-03 Thread Eric V. Smith
Eric V. Smith added the comment: != would be my preference, but it can't work. f'{0!=1}' is already legal. I'm not crazy about !!. I think that will be too confusing. -- ___ Python tracker _

[issue34848] range.index only takes one argument when it's documented as taking the usual 3

2019-05-03 Thread miss-islington
Change by miss-islington : -- pull_requests: +12989 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue36743] Docs: Descript __get__ signature defined differently across the docs

2019-05-03 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Personally, I have always found "instance" and "owner" very confusing names for these arguments. If you want to change the documentation, I would recommend changing those names too. Better names would be "obj" and "cls" or something like that. -- no

[issue36743] Docs: Descript __get__ signature defined differently across the docs

2019-05-03 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > Perhaps the datamodel docs can be clarified to note that callers are allowed > to omit the third argument That's not true in general, only when __get__ is a slot wrapper (i.e. for classes implemented in C). When __get__ is a Python function, nothing specia

[issue34214] Pylint recusion stack overflow abort

2019-05-03 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: FYI: this one-liner installs the crashing versions: pip3 install git+https://github.com/nickdrozd/astroid.git@crash git+https://github.com/nickdrozd/pylint.git@crash -- nosy: +jdemeyer ___ Python tracker

[issue36782] Add tests for the datetime C API

2019-05-03 Thread Eric N. Vander Weele
Change by Eric N. Vander Weele : -- nosy: +ericvw ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue36782] Add tests for the datetime C API

2019-05-03 Thread Paul Ganssle
New submission from Paul Ganssle : A decent fraction of the datetime C API has no tests. If we had tests, we could have prevented bpo #36025, which was a regression in the FromTimestamp method. I would like to open this issue to suggest the addition of tests for the full interface, to prevent

[issue36783] No documentation for _FromXandFold C API functions

2019-05-03 Thread Paul Ganssle
New submission from Paul Ganssle : In Python 3.6, Time_FromTimeAndFold and PyDateTime_FromDateAndTimeAndFold were added as part of the PEP 495 implementation, but no documentation was added for the C API portions of this change: https://docs.python.org/3.7/c-api/datetime.html The functions w

[issue36783] No documentation for _FromXandFold C API functions

2019-05-03 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +Mariatta, cheryl.sabella ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue36784] __import__ with empty folder after importlib.invalidate_caches causes reference leak

2019-05-03 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : I originally hit upon this with issue36777 where I have used support.script_helper.make_script which calls importlib.invalidate_caches and then trying to use __import__ on an empty folder causes reference leak. I tried 3.8 to 3.5 and it exists on

[issue36777] unittest discover throws TypeError on empty packages

2019-05-03 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I opened issue36784 for reference leak in the initial report along with a reproducer that is reproducible on master branch without my changes. -- ___ Python tracker _

[issue34214] Pylint recusion stack overflow abort

2019-05-03 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: What seems to be happening is a recursion error while handling a recursion error. Essentially >>> def f(): ... try: ... f() ... except: ... f() ... >>> f() Fatal Python error: Cannot recover from stack overflow. So unless I'm missing

[issue36512] future_factory argument for Thread/ProcessPoolExecutor

2019-05-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: What is your use case? -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue36341] bind() on AF_UNIX socket may fail in tests run as non-root

2019-05-03 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue36341] bind() on AF_UNIX socket may fail in tests run as non-root

2019-05-03 Thread miss-islington
miss-islington added the comment: New changeset 4461d704e23a13dfbe78ea3020e4cbeff4b68dc2 by Miss Islington (bot) (xdegaye) in branch 'master': bpo-36341: Fix tests calling bind() on AF_UNIX sockets (GH-12399) https://github.com/python/cpython/commit/4461d704e23a13dfbe78ea3020e4cbeff4b68dc2

[issue36613] asyncio._wait() don't remove callback in case of exception

2019-05-03 Thread miss-islington
miss-islington added the comment: New changeset c1964e9e2177eabe821f3e4243be8b99e0d2d542 by Miss Islington (bot) (gescheit) in branch 'master': bpo-36613: call remove_done_callback if exception (GH-12800) https://github.com/python/cpython/commit/c1964e9e2177eabe821f3e4243be8b99e0d2d542

[issue36613] asyncio._wait() don't remove callback in case of exception

2019-05-03 Thread miss-islington
Change by miss-islington : -- pull_requests: +12990 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue36613] asyncio._wait() don't remove callback in case of exception

2019-05-03 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 ___ Python tracker ___ ___

[issue24638] asyncio "loop argument must agree with future" error message could be improved

2019-05-03 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue36613] asyncio._wait() don't remove callback in case of exception

2019-05-03 Thread miss-islington
miss-islington added the comment: New changeset 769ac7e7b809dfc60abd0d7e6f020c6ffe06a6c0 by Miss Islington (bot) in branch '3.7': bpo-36613: call remove_done_callback if exception (GH-12800) https://github.com/python/cpython/commit/769ac7e7b809dfc60abd0d7e6f020c6ffe06a6c0 -- __

[issue24638] asyncio "loop argument must agree with future" error message could be improved

2019-05-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 4737b923df6fbdb9e2bf3fdccea2112270556e0a by Andrew Svetlov (Zackery Spytz) in branch 'master': bpo-24638: Improve the error message in asyncio.ensure_future() (#12848) https://github.com/python/cpython/commit/4737b923df6fbdb9e2bf3fdccea211227055

[issue36509] Add iot layout for windows iot containers

2019-05-03 Thread Paul Monson
Change by Paul Monson : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailin

[issue36782] Add tests for the datetime C API

2019-05-03 Thread Paul Ganssle
Paul Ganssle added the comment: This ticket should be reserved for the mentored sprint. -- assignee: -> Mariatta nosy: +Mariatta ___ Python tracker ___ __

[issue36783] No documentation for _FromXandFold C API functions

2019-05-03 Thread Paul Ganssle
Paul Ganssle added the comment: This ticket should be reserved for the mentored sprint. -- assignee: docs@python -> Mariatta ___ Python tracker ___ ___

[issue35947] Update libffi_msvc to current version of libffi

2019-05-03 Thread Paul Monson
Change by Paul Monson : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailin

[issue17667] Windows: build with "build_pgo.bat -2" fails to optimize python.dll

2019-05-03 Thread Zachary Ware
Change by Zachary Ware : Removed file: https://bugs.python.org/file48296/27409.pdf ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27409] List socket.SO_*, SCM_*, MSG_*, IPPROTO_* symbols

2019-05-03 Thread Zachary Ware
Change by Zachary Ware : -- Removed message: https://bugs.python.org/msg341325 ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue33882] doc Mention breakpoint() in debugger-related FAQ

2019-05-03 Thread Éric Araujo
Éric Araujo added the comment: New changeset cf48e55f7f7718482fa712552f0cbc0aea1c826f by Éric Araujo (Andre Delfino) in branch 'master': bpo-33882: mention breakpoint() in debugger-related FAQ (GH-7759) https://github.com/python/cpython/commit/cf48e55f7f7718482fa712552f0cbc0aea1c826f ---

[issue33882] doc Mention breakpoint() in debugger-related FAQ

2019-05-03 Thread miss-islington
Change by miss-islington : -- pull_requests: +12991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue36785] Implement PEP 574

2019-05-03 Thread Antoine Pitrou
New submission from Antoine Pitrou : Now that PEP 574 (Pickle protocol 5 with out-of-band data) has been accepted, it should be implemented. -- components: Extension Modules, Library (Lib) messages: 341349 nosy: ncoghlan, pitrou priority: normal severity: normal stage: needs patch stat

[issue36786] "make install" should run compileall in parallel

2019-05-03 Thread Antoine Pitrou
New submission from Antoine Pitrou : Title says it all. Currently, "make install" will bytecode-compile Python sources sequentially even though compileall supports doing it in parallel. -- components: Build messages: 341350 nosy: pitrou priority: normal severity: normal stage: needs p

[issue36785] Implement PEP 574

2019-05-03 Thread Antoine Pitrou
Change by Antoine Pitrou : -- keywords: +patch pull_requests: +12992 stage: needs patch -> patch review ___ Python tracker ___ ___ P

[issue36785] Implement PEP 574

2019-05-03 Thread Antoine Pitrou
Change by Antoine Pitrou : -- assignee: -> pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

2019-05-03 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 47541689ccea79dfcb055c6be5800b13fcb6bdd2 by Stefan Behnel in branch 'master': bpo-28238: Implement "{*}tag" and "{ns}*" wildcard tag selection support for ElementPath, and extend the surrounding tests and docs. (GH-12997) https://github.com/pyth

[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

2019-05-03 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue35148] cannot activate a venv environment on a Swiss German windows

2019-05-03 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> venv activate.bat reset codepage fails on windows 10 ___ Python tracker ___

[issue36786] "make install" should run compileall in parallel

2019-05-03 Thread Antoine Pitrou
Change by Antoine Pitrou : -- keywords: +patch pull_requests: +12993 stage: needs patch -> patch review ___ Python tracker ___ ___ P

[issue32309] Implement asyncio.run_in_executor shortcut

2019-05-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: In Python 3.7 loop.run_in_executor() is the only user-faced method that requires a loop. asyncio.ThreadPool() sounds great. Maybe thread group can provide better api. But for Python 3.8 adding `run_in_executor` top-level function looks the only easy and obv

[issue14440] Close background process if IDLE closes abnormally.

2019-05-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: outdated -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue36758] configured libdir not correctly passed to Python executable

2019-05-03 Thread Xavier de Gaye
Xavier de Gaye added the comment: I can reproduce the problem. The Makefile uses LIBDIR as set by configure to install the libraries and this is not consistent with Modules/getpath.c that finds the locations of the libraries (see the detailed comments at the top of the source file) without

[issue36787] Python3 regresison: String formatting of None object

2019-05-03 Thread Gawain Bolton
New submission from Gawain Bolton : Python 2.7.16 (default, Apr 6 2019, 01:42:57) [GCC 8.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print('{:^10}'.format(None)) None However this

[issue36787] Python3 regresison: String formatting of None object

2019-05-03 Thread Gawain Bolton
Gawain Bolton added the comment: Note: I have a patch which fixes this. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36787] Python3 regresison: String formatting of None object

2019-05-03 Thread Zachary Ware
Zachary Ware added the comment: You can use `!s` to be sure that the object is a string: >>> '{!s:^10}'.format(None) ' None ' I think it's unlikely the behavior of NoneType.__format__ will be changed, but I'm adding Eric Smith to make that determination as the maintainer of str.format.

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-03 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +12994 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue36788] Add clamp() function to builtins

2019-05-03 Thread TheComet
New submission from TheComet : It would be nice to have a clamp() builtin in addition to min() and max() so one can type e.g. "clamp(value, 2, 5)" instead of having to type "min(max(value, 5), 2)". -- components: Library (Lib) messages: 341358 nosy: TheComet priority: normal severity:

[issue36788] Add clamp() function to builtins

2019-05-03 Thread TheComet
TheComet added the comment: I have implemented it on my branch here: https://github.com/TheComet/cpython/blob/fix-issue-36788/Python/bltinmodule.c It still needs further testing and I haven't leak checked it properly. -- ___ Python tracker

[issue36787] Python3 regresison: String formatting of None object

2019-05-03 Thread Eric V. Smith
Eric V. Smith added the comment: This behavior isn't going to change. As Zach says, if you want to convert any value to a string, use !s. We want to fail as soon as possible: if a class (such as NoneType) doesn't implement __format__, then trying to format an instance with a format spec that

[issue36788] Add clamp() function to builtins

2019-05-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: I doubt this is important enough to go into builtins, the only practical use-case I know of for this function is with numbers, so this could go in the math module. But putting that aside, there are some other problems: - it isn't clear that clamp() is meani

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-03 Thread jpic
jpic added the comment: I haven't found this specific case in an RFC, but checked Go's net/mail library behavior and it just considers it broken: $ cat mail.go package main import "fmt" import "net/mail" func main() { fmt.Println((&mail.AddressParser{}).Parse("a...@example.com")) fmt.P

[issue36789] Unicode HOWTO incorrectly states that UTF-8 contains no zero bytes

2019-05-03 Thread mbiggs
New submission from mbiggs : In the Unicode HOWTO: http://docs.python.org/3.3/howto/unicode.html It says the following: "UTF-8 has several convenient properties: (...) 2. A Unicode string is turned into a sequence of bytes containing no embedded zero bytes. This avoids byte-ordering issues, a

[issue36789] Unicode HOWTO incorrectly states that UTF-8 contains no zero bytes

2019-05-03 Thread Andrew Svetlov
Andrew Svetlov added the comment: This is right for 99.99% cases: utf8 doesn't encode any character except explicit zero with zero bytes. UTF-16 for example encodes 'a' as b'\xff\xfea\x00' -- nosy: +asvetlov ___ Python tracker

[issue36790] test_asyncio fails with application verifier!

2019-05-03 Thread Alexander Riccio
New submission from Alexander Riccio : I compiled PCBuild Debug x64 from an updated clone of upstream, and when running the testsuite under Application Verifier with handle verification, the test triggers an invalid handle access by passing an invalid overlapped handle to CancelIoEx with this

[issue36790] test_asyncio fails with application verifier!

2019-05-03 Thread Alexander Riccio
Alexander Riccio added the comment: Hmm, proceeding a bit further pointed to finish_recv in windows_events.py -- Added file: https://bugs.python.org/file48299/python_invalid_handle.PNG ___ Python tracker ___

[issue36790] test_asyncio fails with application verifier!

2019-05-03 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +asvetlov, yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-03 Thread jpic
jpic added the comment: The pull request has been updated to mimic net/mail's behavior rather than trying to workaround user input. Before: >>> email.message_from_string('From: a...@malicious.org@important.com', policy=email.policy.default)['from'].addresses (Address(display_name='',

[issue33777] dummy_threading: .is_alive method returns True after execution has completed

2019-05-03 Thread Jeffrey Kintscher
Jeffrey Kintscher added the comment: This behavior still exists in 3.7.3: Python 3.7.3 (default, May 1 2019, 00:00:47) [Clang 10.0.1 (clang-1001.0.46.4)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from dummy_threading import Thread >>> def f(): print

[issue33777] dummy_threading: .is_alive method returns True after execution has completed

2019-05-03 Thread Jeffrey Kintscher
Jeffrey Kintscher added the comment: I also see inconsistent behaviorbetween the enumerate() functions in threading and dummy_threading: Python 3.7.3 (default, May 1 2019, 00:00:47) [Clang 10.0.1 (clang-1001.0.46.4)] on darwin Type "help", "copyright", "credits" or "license" for more infor

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-03 Thread Windson Yang
Windson Yang added the comment: Frome the answer from Alnitak (https://stackoverflow.com/questions/12355858/how-many-symbol-can-be-in-an-email-address). Maybe we should raise an error when the address has multiple @ in it. -- ___ Python tracker <

[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Steven: We shouldn't block this immediately useful feature from going > in for f-strings on waiting for some much broader first class access > to expressions feature. !d would be practical today. I hear you, and after giving it much more thought I agree.

[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is not cp1252

2019-05-03 Thread STINNER Victor
STINNER Victor added the comment: cp65001 is *not* utf-8: Microsoft decided to handle surrogates differently for some reasons. -- ___ Python tracker ___ __

[issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions

2019-05-03 Thread Tom Hale
Tom Hale added the comment: Yes, but by default (because of difficulty) people won't check for this case: 1. I delete existing symlink in order to recreate it 2. Attacker watching symlink finds it deleted and recreates it 3. I try to create symlink, and an unexpected exception is raised -

[issue36791] sum() relies on C signed overflow behaviour

2019-05-03 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : sum() assumes that an arithmetic operation on signed longs will wrap modulo 2**(bits_in_long) on overflow. However, signed overflow causes undefined behaviour according to the C standards (e.g., C99 6.5, para. 5), and gcc is known to assume that signed

[issue36791] sum() relies on C signed overflow behaviour

2019-05-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +12995 stage: -> patch review ___ Python tracker ___ ___ Python-bug

[issue36784] __import__ with empty folder after importlib.invalidate_caches causes reference leak

2019-05-03 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Interesting, I used tracemalloc to see if it helps and it gave me a line in Lib/tempfile.py . Supplying path to support.temp_dir(path="/tmp/") causes random directory code was not to be hit and there was no memory leak. So I removed the _Random() i

[issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions

2019-05-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: So what? Detected problem is better than non-detected problem. If and unexpected exception causes troubles in your code, it is up to you what to do with it: silence it, terminate an application, try to recreate a symlink in other place, etc. In any case th