[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-04-04 Thread Nick Coghlan
Nick Coghlan added the comment: My first thought would be to inject a wordcode instruction that's essentially an eval loop directive: "ATOMIC_UNTIL " ATOMIC_UNTIL would have at least the following properties: - checks for signals are skipped until the given offset is reached - checks to

[issue16510] Using appropriate checks in tests

2017-04-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed Added file: http://bugs.python.org/file46779/tests_asserts_7.patch ___ Python tracker

[issue20547] Use specific asserts in bigmem tests

2017-04-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed Added file: http://bugs.python.org/file46778/test_bigmem_asserts_3.patch ___ Python tracker

[issue20545] Use specific asserts in unicode tests

2017-04-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed Added file: http://bugs.python.org/file46777/test_unicode_asserts_3.patch ___ Python tracker

[issue29987] inspect.isgeneratorfunction not working with partial functions

2017-04-04 Thread Thomas Antony
Thomas Antony added the comment: Is there any way to distinguish such callables from "normal" functions without actually calling them? -- ___ Python tracker

[issue29569] threading.Timer class: Continue periodical execution till action returns True

2017-04-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: Antoine, do you care to make the call on this one? -- assignee: -> pitrou nosy: +pitrou ___ Python tracker ___

[issue29549] Improve docstring for str.index

2017-04-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 43ba8861e0ad044efafa46a7cc04e12ac5df640e by Raymond Hettinger (Lisa Roach) in branch 'master': bpo-29549: Fixes docstring for str.index (#256) https://github.com/python/cpython/commit/43ba8861e0ad044efafa46a7cc04e12ac5df640e --

[issue29446] Improve tkinter 'import *' situation

2017-04-04 Thread Louie Lu
Changes by Louie Lu : -- nosy: +louielu ___ Python tracker ___ ___ Python-bugs-list mailing

[issue29981] Update Index for set, dict, and generator 'comprehensions'

2017-04-04 Thread Louie Lu
Changes by Louie Lu : -- pull_requests: +1170 ___ Python tracker ___ ___ Python-bugs-list

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2017-04-04 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +davin ___ Python tracker ___ ___

[issue29981] Update Index for set, dict, and generator 'comprehensions'

2017-04-04 Thread Louie Lu
Changes by Louie Lu : -- nosy: +louielu ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24117] Wrong range checking in GB18030 decoder.

2017-04-04 Thread Ma Lin
Changes by Ma Lin : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue29990] Range checking in GB18030 decoder

2017-04-04 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list

[issue29990] Range checking in GB18030 decoder

2017-04-04 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +1168 ___ Python tracker ___

[issue29990] Range checking in GB18030 decoder

2017-04-04 Thread Ma Lin
New submission from Ma Lin: This issue is split from issue24117, that issue became a soup of small issues, so I'm going to close it. For 4-byte GB18030 sequence, the legal range is: 0x81-0xFE for the 1st byte 0x30-0x39 for the 2nd byte 0x81-0xFE for the 3rd byte 0x30-0x39 for the 4th byte

[issue13290] get vars for object with __slots__

2017-04-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think this API expansion should not be done. As a teacher of Python, I find that vars(o) is easily understood as a short-cut for o.__dict__ in much the same way as len(o) is a short-cut for o.__len__(). The proposed change makes this tool harder to

[issue29989] subprocess.Popen does not handle file-like objects without file descriptors

2017-04-04 Thread Raphael Gaschignard
New submission from Raphael Gaschignard: >From the documentation of the io module: fileno() Return the underlying file descriptor (an integer) of the stream if it exists. An OSError is raised if the IO object does not use a file descriptor. However, when passing a file-like object without a

[issue29987] inspect.isgeneratorfunction not working with partial functions

2017-04-04 Thread Martin Panter
Martin Panter added the comment: Doesn't seem like a bug to me. Even if there was special support for "partial" objects, that won't help with other ways of producing the same sort of thing. test2 = functools.partial(test, a=10) @functools.wraps(test) def test2(): return test(a=10) Both

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2017-04-04 Thread Devin Jeanpierre
Devin Jeanpierre added the comment: Yeah, I agree there might be a use-case (can't find one offhand, but in principle), but I think it's rare enough that you're more likely to be led astray from reading this note -- almost always, NotImplemented does what you want. In a way this is a special

[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-04-04 Thread Nathaniel Smith
New submission from Nathaniel Smith: You might hope the interpreter would enforce the invariant that for 'with' and 'async with' blocks, either '__(a)enter__' and '__(a)exit__' are both called, or else neither of them is called. But it turns out that this is not true once KeyboardInterrupt

[issue29987] inspect.isgeneratorfunction not working with partial functions

2017-04-04 Thread Thomas Antony
Changes by Thomas Antony : -- versions: +Python 3.6 ___ Python tracker ___ ___

[issue29987] inspect.isgeneratorfunction not working with partial functions

2017-04-04 Thread Thomas Antony
New submission from Thomas Antony: When inspect.isgeneratorfunction is called on the output of functools.partial, it returns False even if the original function was a generator function. Test case is attached. Tested in fresh conda environment running Python 3.6.1 -- files:

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2017-04-04 Thread R. David Murray
R. David Murray added the comment: The documentation is technically correct, as far as I can see. Issue 8743 is not about disallowing certain comparison operations, but rather incorrectly implementing the earlier sentence in that same doc section: "If the comparison is undefined, it must

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2017-04-04 Thread Devin Jeanpierre
Devin Jeanpierre added the comment: Sorry, forgot to link to docs because I was copy-pasting from the PR: https://docs.python.org/2/c-api/typeobj.html#c.PyTypeObject.tp_richcompare https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_richcompare > Note: If you want to implement a

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2017-04-04 Thread Devin Jeanpierre
New submission from Devin Jeanpierre: am not sure when TypeError is the right choice. Definitely, most of the time I've seen it done, it causes trouble, and NotImplemented usually does something better. For example, see the work in https://bugs.python.org/issue8743 to get set to interoperate

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-04 Thread Dominic Mayers
Changes by Dominic Mayers : Added file: http://bugs.python.org/file46775/Issue29947_for_discussion_03.patch ___ Python tracker ___

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-04 Thread Dominic Mayers
Changes by Dominic Mayers : Removed file: http://bugs.python.org/file46774/Issue29947_for_discussion_02.patch ___ Python tracker ___

[issue29985] make install doesn't seem to support --quiet

2017-04-04 Thread Chris Jerdonek
New submission from Chris Jerdonek: When installing from source, the --quiet option works with "configure" and a bare "make": $ ./configure --quiet $ make --quiet However, it doesn't seem to work when passed to "make install" (and "make altinstall", etc). I tried a number of

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-04 Thread Dominic Mayers
Changes by Dominic Mayers : Removed file: http://bugs.python.org/file46770/Issue29947_for_discussion.patch ___ Python tracker ___

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-04 Thread Dominic Mayers
Dominic Mayers added the comment: I simplified the patch. Using a class as a factory function is the simplest case, so I took advantage of this. I also give one way to pass extra parameters to the handler in the factory function, because it's the main reason why we cannot always use a class.

[issue7659] Attribute assignment on object() instances raises wrong exception

2017-04-04 Thread R. David Murray
R. David Murray added the comment: Agreed. Time to close this. -- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue29905] TypeErrors not formatting values correctly

2017-04-04 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- pull_requests: +1166 ___ Python tracker ___

[issue29977] re.sub stalls forever on an unmatched non-greedy case

2017-04-04 Thread Matthew Barnett
Matthew Barnett added the comment: A slightly shorter form: /\*(?:(?!\*/).)*\*/ Basically it's: match start while not match end: consume character match end If the "match end" is a single character, you can use a negated character set, for example: [^\n]*

[issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs

2017-04-04 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: You could try: glob = globals.copy() glob.update(a.__dict__) glob.update(b.__dict__) You can do this automatically following MyClass.__mro__ and then collecting relevant __module__ attributes on bases. However, there is little chance this will be fixed in

[issue29982] tempfile.TemporaryDirectory fails to delete itself

2017-04-04 Thread Eryk Sun
Changes by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.7 ___ Python tracker

[issue7659] Attribute assignment on object() instances raises wrong exception

2017-04-04 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: I don't think a change is actually needed here (bumping to decide the fate of this issue) -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker

[issue28087] macOS 12 poll syscall returns prematurely

2017-04-04 Thread Ennis Massey
Ennis Massey added the comment: Makes sense it would also fail. They both use the same syscall. Gud job on the backport Sent from my iPhone > On 4/04/2017, at 4:50 AM, STINNER Victor wrote: > > > STINNER Victor added the comment: > > Ah! Python 2.7 tests succeeded

[issue29860] smtplib.py doesn't capitalize EHLO.

2017-04-04 Thread Maciej Szulik
Changes by Maciej Szulik : -- nosy: +maciej.szulik ___ Python tracker ___ ___

[issue29984] Improve test coverage for 'heapq' module

2017-04-04 Thread Robert Day
Changes by Robert Day : -- pull_requests: +1165 ___ Python tracker ___ ___

[issue29984] Improve test coverage for 'heapq' module

2017-04-04 Thread Robert Day
New submission from Robert Day: It's currently at 97%: Name Stmts Miss Cover Missing Lib/heapq.py 262 797% 187, 351-352, 375-376, 606-607 I'm submitting a Github PR to fix it. -- components: Tests messages:

[issue29970] Severe open file leakage running asyncio SSL server

2017-04-04 Thread Yury Selivanov
Yury Selivanov added the comment: I'm assigning this to myself to make sure I don't forget about this. If someone wants to tackle this please feel free to reassign. -- assignee: -> yselivanov versions: +Python 3.7 ___ Python tracker

[issue29970] Severe open file leakage running asyncio SSL server

2017-04-04 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +giampaolo.rodola, haypo ___ Python tracker ___ ___

[issue28681] About function renaming in the tutorial

2017-04-04 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___

[issue29905] TypeErrors not formatting values correctly

2017-04-04 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: As per #issue25002 and, specifically #msg250151, the TypeError in `asynchat` should probably not be included, I'll just make a PR for the TypeError in asyncio/proactor_events -- ___ Python tracker

[issue13290] get vars for object with __slots__

2017-04-04 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___

[issue29983] Reference TOC: expand 'Atoms' and 'Primaries'

2017-04-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: 'displays' is partly redundant with 'comprehensions'. Since many think of other 'displays' as a type of literal, leave 'displays' out. They are well indexed. I think the most likely term people have trouble finding in the TOC is 'comprehension'. It was

[issue29983] Reference TOC: expand 'Atoms' and 'Primaries'

2017-04-04 Thread Terry J. Reedy
New submission from Terry J. Reedy: Today there is a fairly long python-list thread about the difficult of finding info on 'dict comprehensions' in the doc. Point 1 is missing index entries. I opened #29981 for this. Point 2 is something I have also noticed: the obscurity of 'Atoms' and

[issue29981] Update Index for set, dict, and generator 'comprehensions'

2017-04-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: See #29983 for expanding the title of the 'atoms' section containing subsections on comprehensions. -- title: Update Index set, dict, and generator 'comprehensions' -> Update Index for set, dict, and generator 'comprehensions'

[issue29982] tempfile.TemporaryDirectory fails to delete itself

2017-04-04 Thread Max
New submission from Max: There's a known issue with `shutil.rmtree` on Windows, in that it fails intermittently. The issue is well known (https://mail.python.org/pipermail/python-dev/2013-September/128353.html), and the agreement is that it cannot be cleanly solved inside `shutil` and

[issue29981] Update Index set, dict, and generator 'comprehensions'

2017-04-04 Thread Terry J. Reedy
New submission from Terry J. Reedy: The index currently has comprehensions *list* with *list* linked to 6.2.5 List displays. I suggest: 1. Link *comprehensions* to 6.2.4. Displays for lists, sets and dictionaries 2. Add subentries *set*, *dict*, and *generator* linked to 2a. 6.2.6. Set

[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-04 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Gotcha, thanks for the input, David. I'll leave it to you to decide if the sentence on the trailing comments warrants removal. -- resolution: -> rejected stage: -> resolved status: open -> closed ___

[issue29980] OSError: multiple exceptions should preserve the exception type if it is common

2017-04-04 Thread R. David Murray
R. David Murray added the comment: If all connections fail (not file :) -- ___ Python tracker ___ ___

[issue29980] OSError: multiple exceptions should preserve the exception type if it is common

2017-04-04 Thread R. David Murray
New submission from R. David Murray: create_connection will try multiple times to connect if there are multiple addresses returned by getaddrinfo. If all connections file it inspects the exceptions, and raises the first one if they are all equal. But since the addresses are often different

[issue29851] Have importlib.reload() raise ModuleNotFoundError when a spec can't be found

2017-04-04 Thread Brett Cannon
Brett Cannon added the comment: That's a good point, Serhiy, since that's what the exception is signaling. So yes, the exception should be ModuleNotFounderror. -- title: Have importlib.reload() raise ImportError when a spec can't be found -> Have importlib.reload() raise

[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2017-04-04 Thread Nick Coghlan
Nick Coghlan added the comment: Reviewing the discussion, I assume this was left open to cover reordering the __aenter__ and __aexit__ checks for async with, but that can just as easily be handled as a separate issue (which would also be clearer at the NEWS level). -- stage: patch

[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-04 Thread R. David Murray
R. David Murray added the comment: I don't see any omission, myself. Keep in mind that the language reference is as much or more of a specification as it is a reference, so we tend to try to use the minimum language that precisely describes the expected behavior. Which is why I suggested

[issue29979] cgi.parse_multipart is not consistent with FieldStorage

2017-04-04 Thread Pierre Quentel
Changes by Pierre Quentel : -- pull_requests: +1163 ___ Python tracker ___ ___

[issue29979] cgi.parse_multipart is not consistent with FieldStorage

2017-04-04 Thread Senthil Kumaran
Senthil Kumaran added the comment: Looking forward to this. -- assignee: -> orsenthil nosy: +orsenthil ___ Python tracker ___

[issue29979] cgi.parse_multipart is not consistent with FieldStorage

2017-04-04 Thread Pierre Quentel
Changes by Pierre Quentel : -- pull_requests: +1162 ___ Python tracker ___ ___

[issue29978] Remove remove merge=union attribute for Misc/NEWS in 3.6 and 2.7

2017-04-04 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue29974] Change typing.TYPE_CHECKING doc example

2017-04-04 Thread Mathias Rav
Mathias Rav added the comment: I have updated the patch after feedback from Jelle Zijlstra and Ivan Levkevskyi. Indeed the example was correct; the patch now adds wording from PEP 484 and PEP 526 to clarify why a function parameter annotation needs to be in quotes and a local variable

[issue29974] Change typing.TYPE_CHECKING doc example

2017-04-04 Thread Mathias Rav
Changes by Mathias Rav : -- title: typing.TYPE_CHECKING doc example is incorrect -> Change typing.TYPE_CHECKING doc example ___ Python tracker

[issue29649] struct.pack_into check boundary error message ignores offset

2017-04-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Andrew. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29649] struct.pack_into check boundary error message ignores offset

2017-04-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f78b119364b521307237a1484ba5f43f42300898 by Serhiy Storchaka (Andrew Nester) in branch 'master': bpo-29649: Improve struct.pack_into() boundary error messages (#424)

[issue29978] Remove remove merge=union attribute for Misc/NEWS in 3.6 and 2.7

2017-04-04 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +1160 ___ Python tracker ___ ___

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-04 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: Currently we haven't updated to Python 3.6.1 at Fedora 26 due to this issue. While it is a release blocker for 3.6.2, what can be done for 3.6.1? -- ___ Python tracker

[issue29971] Lock.acquire() not interruptible on Windows

2017-04-04 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue29978] Remove remove merge=union attribute for Misc/NEWS in 3.6 and 2.7

2017-04-04 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +1159 ___ Python tracker ___ ___

[issue29979] cgi.parse_multipart is not consistent with FieldStorage

2017-04-04 Thread Pierre Quentel
New submission from Pierre Quentel: In the cgi module, the parse_multipart() function duplicates code from FieldStorage, and the result is not compliant with that of FieldStorage for requests sent with multipart/form-data : for non-file fields, the value associated with a key is a list of

[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-04-04 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- versions: +Python 3.5, Python 3.6 ___ Python tracker ___

[issue11066] cgi.py proposals : sys.stdout encoding + rewriting of parsing functions

2017-04-04 Thread Pierre Quentel
Pierre Quentel added the comment: I close this issue and will open a more specific one for the rewriting of parse_multipart() -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue29978] Remove remove merge=union attribute for Misc/NEWS in 3.6 and 2.7

2017-04-04 Thread Mariatta Wijaya
New submission from Mariatta Wijaya: In https://github.com/python/cpython/pull/212, merge=union was added to the .gitattributes, but was later removed in https://github.com/python/cpython/pull/460. Somehow this attribute made their way into 3.6 and 2.7. I will remove it. --

[issue29972] Skip tests known to fail on AIX

2017-04-04 Thread STINNER Victor
STINNER Victor added the comment: New changeset 5de85a17029356084b96db63e04d9eb150efd9c0 by Victor Stinner in branch 'master': bpo-29972: Skip tests known to fail on AIX (#979) https://github.com/python/cpython/commit/5de85a17029356084b96db63e04d9eb150efd9c0 --

[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-04-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: needs patch -> backport needed ___ Python tracker ___

[issue29971] Lock.acquire() not interruptible on Windows

2017-04-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: I am not competent enough to pronounce on the technical detail of what you are proposing, but: > Or maybe refactor to use condition variables in performance-critical code and > otherwise use kernel waits, if that makes sense. That can make sense IMHO. Lock

[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-04-04 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Serhiy, just checking whether this needs backport? The PR has the backport to 3.5 and 3.6 labels, but it's not indicated in this ticket. If it doesn't need backport, then perhaps we can close this issue. Thanks. -- nosy: +Mariatta

[issue29977] re.sub stalls forever on an unmatched non-greedy case

2017-04-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a well known issue called catastrophic backtracking. It can't be solved with the current implementation of the regular expression engine. The best you can rewrite your regular expression. Even replacing "(.|\s)" with just "." can help. --

[issue29977] re.sub stalls forever on an unmatched non-greedy case

2017-04-04 Thread Gareth Rees
Gareth Rees added the comment: See also issue28690, issue212521, issue753711, issue1515829, etc. -- ___ Python tracker ___

[issue29977] re.sub stalls forever on an unmatched non-greedy case

2017-04-04 Thread Gareth Rees
Gareth Rees added the comment: The problem here is that both "." and "\s" match a whitespace character, and because you have the re.DOTALL flag turned on this includes "\n", and so the number of different ways in which (.|\s)* can be matched against a string is exponential in the number of

[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-04 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Ah, yes, the Ref. Manual, not the devguide, silly mistake. It definitely isn't a documentation bug (the documentation doesn't state something wrong) as much as I think it might be a slight omission. I really wasn't aware of how strict the tokenizer is

[issue29977] re.sub stalls forever on an unmatched non-greedy case

2017-04-04 Thread Robert Lujo
New submission from Robert Lujo: Hello, I assume I have hit some bug/misbehaviour in re module. I will provide you "working" example: import re RE_C_COMMENTS= re.compile(r"/\*(.|\s)*?\*/", re.MULTILINE|re.DOTALL|re.UNICODE) text = "Special section /*

[issue19180] some RFC references could be updated

2017-04-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +christian.heimes stage: needs patch -> patch review ___ Python tracker ___