[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I respectfully disagree that this just happens to people accidentally -- Every single day, I work with either Python professionals or Python students and never see this situation occur, nor have I had a single report of it from

[issue31457] LoggerAdapter objects cannot be nested

2017-10-18 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +4015 ___ Python tracker ___ ___

[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Nick Coghlan
Nick Coghlan added the comment: To put this another way: I see an uninterruptible infinite loop as a data loss bug on par with a segfault, since there's no graceful way to terminate the process and allow cleanup code to run. For segfaults, we're willing to tolerate them,

[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Nick Coghlan
Nick Coghlan added the comment: Defensive coding and the complications it brings is a fact of life when providing a widely used platform. Sure, we're free to say "We don't care about minor user experience irritations like Ctrl-C not always being reliable, users should

[issue31457] LoggerAdapter objects cannot be nested

2017-10-18 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 537ed75291ed8a640887f199f98e2e5076ef87b6 by Łukasz Langa (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31457: Make the `LoggerAdapter.manager` property settable (GH-4042) (#4043)

[issue31457] LoggerAdapter objects cannot be nested

2017-10-18 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4014 ___ Python tracker ___

[issue31457] LoggerAdapter objects cannot be nested

2017-10-18 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 0b6a118a45ac2eded1348fea6ed300d5651f7471 by Łukasz Langa in branch 'master': bpo-31457: Make the `LoggerAdapter.manager` property settable (#4042) https://github.com/python/cpython/commit/0b6a118a45ac2eded1348fea6ed300d5651f7471

[issue31457] LoggerAdapter objects cannot be nested

2017-10-18 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +4013 ___ Python tracker ___ ___

[issue30140] Binary arithmetic does not always call subclasses first

2017-10-18 Thread Stephan Hoyer
Stephan Hoyer added the comment: Ping -- it would be great if someone could take a look at my PR. (I suspect it needs more documentation, tips on where to put that would be appreciated.) -- ___ Python tracker

[issue31454] Include "import as" in tutorial

2017-10-18 Thread Mario Corchero
Change by Mario Corchero : -- keywords: +patch pull_requests: +4012 stage: needs patch -> patch review ___ Python tracker ___

[issue31454] Include "import as" in tutorial

2017-10-18 Thread Mario Corchero
Change by Mario Corchero : -- nosy: +mariocj89 ___ Python tracker ___ ___

[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-10-18 Thread Mario Corchero
Mario Corchero added the comment: Wrote https://bugs.python.org/issue31800 without realising this issue was open (Thanks for bringing it up Martin Panter). issue31800 basically just adds the ability to parse NN:NN to the already existing python isoformat function when %z

[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Koos Zevenhoven
Koos Zevenhoven added the comment: To repeat one of my points in the linked threads, I'm not convinced that infinite iterators are the most common case for the problem of long uninterruptible loops. A general mechanism that can be easily used in many places with minimal

[issue31742] Default to emitting FutureWarning for provisional APIs

2017-10-18 Thread Ethan Furman
Change by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___

[issue9253] argparse: optional subparsers

2017-10-18 Thread paul j3
paul j3 added the comment: In a recent stackoverflow question a user wanted this optional-subparsers ability in Python 2.7. https://stackoverflow.com/questions/46667843/how-to-set-a-default-subparser-using-argparse-module-with-python-2-7 Short of modifying the

[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Raymond. I cited the same arguments in the discussion on Python-ideas. But the other solution that was suggested in this discussion will add more complexity and can't solve all cases. --

[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With optimized repeat(): $ ./python -m perf timeit --compare-to=../cpython-release/python -s 'from itertools import repeat' 'list(repeat(None, 100))' /home/serhiy/py/cpython-release/python: . 3.77 ms +-

[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Microbenchmark results: $ ./python -m perf timeit --compare-to=../cpython-release/python -s 'from itertools import repeat' 'list(repeat(None, 100))' /home/serhiy/py/cpython-release/python: . 3.79 ms +-

[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: When I have time, I would like to re-launch a python-dev discussion on this. It is my feeling that this solves an invented problem. In my experience, it only ever happens to people who have intentionally trying to create this

[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___

[issue31778] ast.literal_eval supports non-literals in Python 3

2017-10-18 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: -yselivanov ___ Python tracker ___ ___

[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2017-10-18 Thread Wilfred Hughes
Wilfred Hughes added the comment: Note that this also affects the singledispatch library that backports singledispatch to Python 2: https://github.com/python/typing/issues/484 -- nosy: +Wilfred.Hughes ___ Python tracker

[issue31815] Make itertools iterators interruptible

2017-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- title: Make itertools iterators interrable -> Make itertools iterators interruptible ___ Python tracker

[issue31815] Make itertools iterators interrable

2017-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4011 ___ Python tracker ___

[issue31815] Make itertools iterators interrable

2017-10-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Proposed PR makes tight C loops with itertools iterators interruptible with Ctrl-C. It adds checks for keyboard interrupt in iterators that can produce long sequences without advancing other iterators. For performance checks

[issue31814] subprocess_fork_exec more stable with vfork

2017-10-18 Thread Albert Zeyer
New submission from Albert Zeyer : subprocess_fork_exec currently calls fork(). I propose to use vfork() or posix_spawn() or syscall(SYS_clone, SIGCHLD, 0) instead if possible and if there is no preexec_fn. The difference would be that fork() will call any atfork

[issue31809] ssl module unnecessarily pins the client curve when using ECDH

2017-10-18 Thread Christian Heimes
Christian Heimes added the comment: - BoringSSL is not a supported libssl/libcrypto library for Python. We only support 100% OpenSSL-compatible libraries. - OpenSSL 1.0.1 is no longer supported by upstream. Python's semi-official support policy for 1.0.1 and 0.9.8 is "use at

[issue31809] ssl module unnecessarily pins the client curve when using ECDH

2017-10-18 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +4010 stage: -> patch review ___ Python tracker ___

[issue31813] python -m enshure pip stucks

2017-10-18 Thread Serhy Pyton
New submission from Serhy Pyton : pip stucks, during installing python 3.6.3 in termux and not complete it. Posibly it's could be a problem only on meizu m2. Also it produse load in such state. -- components: Installation files: S71018-182104.jpg messages: 304585

[issue31812] Document PEP 545 (documentation translation) in What's New in Python 3.7

2017-10-18 Thread STINNER Victor
New submission from STINNER Victor : The PEP 545 should be documented in What's New in Python 3.7: mention that the Python documentation is now *officially* translated to french and japanese. -- assignee: docs@python components: Documentation messages: 304584

[issue31811] async and await missing from keyword list in lexical analysis doc

2017-10-18 Thread Colin Dunklau
New submission from Colin Dunklau : I see that code making async/await real keywords has been merged, but it looks like Doc/reference/lexical_analysis.rst doesn't have those added https://github.com/python/cpython/blob/4a2d00c/Doc/reference/lexical_analysis.rst#keywords

[issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols

2017-10-18 Thread STINNER Victor
New submission from STINNER Victor : Recently, a new "cell_set_contents()" public symbol was added by mistake: see bpo-30486. It was quickly noticed by doko, and fixed by me (commit 0ad05c32cc41d4c21bfd78b9ffead519ead475a2). The problem is that we already have a

[issue31809] ssl module unnecessarily pins the client curve when using ECDH

2017-10-18 Thread Andy
Andy added the comment: While debugging I reproduced this on - 'OpenSSL 1.1.0f 25 May 2017' - 'OpenSSL 1.0.1f 6 Jan 2014' - and 'BoringSSL', latest. using Python 2.7.12, 2.7.13, 2.7.6 and 3.5.3. This was all on Debian. Note that since I used Python <2.7.14 (or

[issue31778] ast.literal_eval supports non-literals in Python 3

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 4035 makes ast.literal_eval() more strict. -- versions: -Python 3.6, Python 3.8 ___ Python tracker

[issue31778] ast.literal_eval supports non-literals in Python 3

2017-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4009 stage: -> patch review ___ Python tracker ___

[issue31809] ssl module unnecessarily pins the client curve when using ECDH

2017-10-18 Thread Christian Heimes
Christian Heimes added the comment: Which version of OpenSSL are you using? Please note that macOS' system python uses either an ancient version of OpenSSL 0.9.8 or an ancient version of LibreSSL (IIRC 2.3.x). The code in question is: if !defined(OPENSSL_NO_ECDH) &&

[issue29854] Segfault when readline history is more then 2 * history size

2017-10-18 Thread STINNER Victor
STINNER Victor added the comment: FYI I added the test.pythoninfo utility as a follow-up of this issue to log many informations to debug Python, not only the readline version: see bpo-30871. -- ___ Python tracker

[issue31809] ssl module unnecessarily pins the client curve when using ECDH

2017-10-18 Thread A
New submission from A : When using elliptic curves in combination with the ssl module to wrap a socket, the only curve the client accepts is prime256v1. Expected behavior is to accept all curves that are on the default list and supported by the server. We noticed the

[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2017-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka components: +XML nosy: +serhiy.storchaka versions: +Python 3.7 -Python 3.4 ___ Python tracker

[issue31806] Use _PyTime_ROUND_TIMEOUT in _threadmodule.c, timemodule.c and socketmodule.c

2017-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.6 ___ Python tracker

[issue31334] select.poll.poll fails on BSDs with arbitrary negative timeouts

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 27b951c63353345cdf7a9a8c4c8133a5dafd6a80 by Serhiy Storchaka (Riccardo Coccioli) in branch '2.7': [2.7] bpo-31334: Fix timeout in select.poll.poll() (GH-3277) (#4034)

[issue31334] select.poll.poll fails on BSDs with arbitrary negative timeouts

2017-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue31334] select.poll.poll fails on BSDs with arbitrary negative timeouts

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 97abcabc195b87d6a5562dbb867a469fac27d3f6 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31334: Fix timeout in select.poll.poll() (GH-3277) (#4033)

[issue31778] ast.literal_eval supports non-literals in Python 3

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: """ The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, and None. """ 1+1 is not a literal number. """ It is not capable of

[issue31778] ast.literal_eval supports non-literals in Python 3

2017-10-18 Thread R. David Murray
R. David Murray added the comment: "Safely evaluate an expression node or a string containing a Python expression." The behavior you are citing matches that documentation, as far as I can see. 1+1 is an expression involving supported literals. -- nosy:

[issue31334] select.poll.poll fails on BSDs with arbitrary negative timeouts

2017-10-18 Thread Riccardo Coccioli
Change by Riccardo Coccioli : -- pull_requests: +4008 ___ Python tracker ___ ___

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-18 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 18.10.2017 11:45, STINNER Victor wrote: > Marc-Andre, Ethan: What do you think of removing the deprecation warning from > the C (my last commit), leave the deprecation warning in the documentation, > and modify time.clock() to become

[issue29696] Use namedtuple in string.Formatter.parse iterator response

2017-10-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: With the exception of string.FormatterItem, which is the change at hand. -- ___ Python tracker

[issue29696] Use namedtuple in string.Formatter.parse iterator response

2017-10-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: IMHO this change makes things a bit more consistent. In lots of places when a tuple is returned, a `structseq` is used to improve readability on the returned result. Some examples of this are: * grp.struct_group * os.terminal_size

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-18 Thread STINNER Victor
STINNER Victor added the comment: "Initially the time module was a thin wrapper around C and OS time-related functions. It may be confusing that the behavior of time.clock() differs from the behavior of C's clock()." Well, there is the theory, and there is the

[issue31806] Use _PyTime_ROUND_TIMEOUT in _threadmodule.c, timemodule.c and socketmodule.c

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset be4e9cc769aac3cb46670c049b9f21e412be53d1 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31806: Use _PyTime_ROUND_TIMEOUT for the timeout argument parsing in more functions (GH-4026) (#4032)

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Initially the time module was a thin wrapper around C and OS time-related functions. It may be confusing that the behavior of time.clock() differs from the behavior of C's clock(). The documentation for clock() on MSDN suggests

[issue30156] PYTHONDUMPREFS segfaults on exit

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maybe the difference is processor depending. I'm going to repeat benchmarking on 32-bit processors. Or maybe fast call was optimized in master. Or passing via an arguments tuple was pessimized. --

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-18 Thread STINNER Victor
STINNER Victor added the comment: (I reopen the issue since the discussion is not over.) Marc-Andre Lemburg: "time.cock() is used in a lot of code." I ran a quick search on GitHub. I found different use cases of time.clock(): 1) Measure performance. On Windows,

[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Pablo. The issue is fixed in 3.6 and 3.7. It is hard to fix it in 2.7. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue31808] tarfile.extractall fails to overwrite symlinks

2017-10-18 Thread Frederic Beister
New submission from Frederic Beister : The fix for https://bugs.python.org/issue10761 somehow didn't make it into 3.5 and later - I have the same behavior as described there in 3.5.1 and 3.6.1 (tested on Ubuntu 16.04) -- components: Library (Lib)

[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ed267e3305a54eddae8106bdaae2c62d4c3b7db6 by Serhiy Storchaka in branch '2.7': [2.7] bpo-31786: Make functions in the select module blocking when timeout is a small negative value. (GH-4003). (#4031)

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-18 Thread STINNER Victor
STINNER Victor added the comment: Marc Andre Lemburg: "time.cock() is used in a lot of code. Why can't we simply replace the functionality with one of the other functions ? The documentation certainly allows for such a change, since it pretty much just says that only

[issue31806] Use _PyTime_ROUND_TIMEOUT in _threadmodule.c, timemodule.c and socketmodule.c

2017-10-18 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4006 ___ Python tracker ___

[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 95602b368b87da3702a0f340ded2a23e823bb104 by Serhiy Storchaka (Pablo Galindo) in branch '3.6': [3.6] bpo-31786: Make functions in the select module blocking when timeout is a small negative value. (GH-4003).

[issue31676] test.test_imp.ImportTests.test_load_source has side effects

2017-10-18 Thread STINNER Victor
STINNER Victor added the comment: I tested "./python -m test -uall -M4G test_imp test_cgitb" on 3.6 and the master branch. Both tests now pass correctly. I close the issue. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue31334] select.poll.poll fails on BSDs with arbitrary negative timeouts

2017-10-18 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +4007 ___ Python tracker ___

[issue31786] In select.poll.poll() ms can be 0 if timeout < 0

2017-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4005 ___ Python tracker ___ ___

[issue31780] Using format spec ',x' displays incorrect error message

2017-10-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Correct. Fixed. -- ___ Python tracker ___ ___

[issue31806] Use _PyTime_ROUND_TIMEOUT in _threadmodule.c, timemodule.c and socketmodule.c

2017-10-18 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4004 ___ Python tracker ___

[issue31806] Use _PyTime_ROUND_TIMEOUT in _threadmodule.c, timemodule.c and socketmodule.c

2017-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 59af94fa61bf90adbe624508e909b5d6ef6e8464 by Serhiy Storchaka (Pablo Galindo) in branch 'master': bpo-31806: Use _PyTime_ROUND_TIMEOUT for the timeout argument parsing in more functions (#4026)

[issue31803] time.clock() should emit a DeprecationWarning

2017-10-18 Thread Ethan Furman
Ethan Furman added the comment: I agree with MAL; removing functions just makes multi-version code more painful. At least have the DeprecationWarning active for two releases before removing it. -- nosy: +ethan.furman ___