[issue29863] Add a COMPACT constant to the json module

2017-04-02 Thread Berker Peksag
Berker Peksag added the comment: +1. See msg287773 for my reasoning. -- nosy: +berker.peksag ___ Python tracker ___

[issue29926] time.sleep ignores _thread.interrupt_main()

2017-04-02 Thread Martin Panter
Martin Panter added the comment: BTW pthread_kill was only added to Python 3.3, so is not available for Python 2. I’m not sure what the best fix for 2.7 would be. Maybe it’s not worth it, or maybe you can find another way to a signal to the user process or its main thread without interfering

[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-02 Thread Michael Selik
Michael Selik added the comment: This would also enable negative indexing, which currently raises "IndexError: no such group". Edit: I meant whole numbers, not natural numbers. -- versions: +Python 3.7 ___ Python tracker

[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-02 Thread Michael Selik
Changes by Michael Selik : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett type: -> enhancement ___ Python tracker

[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-02 Thread Michael Selik
New submission from Michael Selik: Currently, slicing a MatchObject causes an IndexError and len() a TypeError. It's natural to expect slicing and len to work on objects of a finite length that index by natural numbers. -- messages: 291050 nosy: selik priority: normal severity: normal

[issue29926] time.sleep ignores _thread.interrupt_main()

2017-04-02 Thread Martin Panter
Martin Panter added the comment: Hi Terry, this patch is what I imagined a fix would look like for Linux. I am not familiar with Idle (internally nor externally), so there may be improvements you can make. It works as I expected for normal blocking functions and a tight “for” loop: it

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

2017-04-02 Thread Dominic Mayers
Dominic Mayers added the comment: I started to look at the documentation to see what would need to be changed, assuming that we agree for a change in the API. Just for the purpose of this discussion, I created a patch that only change the comments in socketserver.py. --

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

2017-04-02 Thread Dominic Mayers
Changes by Dominic Mayers : -- keywords: +patch Added 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-02 Thread Dominic Mayers
Changes by Dominic Mayers : Removed file: http://bugs.python.org/file46768/factorymixinclass ___ Python tracker ___

[issue19225] lack of PyExc_BufferError doc

2017-04-02 Thread Kinebuchi Tomohiko
Kinebuchi Tomohiko added the comment: I created backporting pull requests for 2.7, 3.5 and 3.6. -- ___ Python tracker ___

[issue19225] lack of PyExc_BufferError doc

2017-04-02 Thread Kinebuchi Tomohiko
Changes by Kinebuchi Tomohiko : -- pull_requests: +1145 ___ Python tracker ___ ___

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Martin Panter
Martin Panter added the comment: We could change this to a documentation issue if you have any suggestions to make the documentation clearer. I understand the “time” module is mainly a wrapper or emulator of the OS’s own strptime, mktime, etc functions, which explains some of these quirks.

[issue19225] lack of PyExc_BufferError doc

2017-04-02 Thread Kinebuchi Tomohiko
Changes by Kinebuchi Tomohiko : -- pull_requests: +1144 ___ Python tracker ___ ___

[issue19225] lack of PyExc_BufferError doc

2017-04-02 Thread Kinebuchi Tomohiko
Changes by Kinebuchi Tomohiko : -- pull_requests: +1143 ___ Python tracker ___ ___

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Paul Pinterits
Paul Pinterits added the comment: No no, the docs are correct. This was definitely my mistake. I'm just trying to say that it's rather confusing how there's only partial support for time zones. When I saw that there is support for parsing the time zone offset, I assumed that the functions

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Martin Panter
Martin Panter added the comment: As far as I can see, the documentation only claims that “mktime” converts local time. If you saw a suggestion that it supports arbitrary time zones, please point it out. -- ___ Python tracker

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Paul Pinterits
Paul Pinterits added the comment: I see. You're right, it does make a difference. However, this behaviour is quite unexpected. Perhaps I just didn't read the docs carefully enough, but it wasn't clear to me that the time module had such half-baked support for time zones. An unsuspecting

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Martin Panter
Martin Panter added the comment: Are you sure? It works for me: >>> strptime("+0200", "%z").tm_gmtoff 7200 >>> strptime("+", "%z").tm_gmtoff 0 The "struct_time" class is documented as a named tuple, but the time zone offset is not one of the tuple elements, so isn’t going to be checked

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Paul Pinterits
New submission from Paul Pinterits: %z is listed as a supported directive in the python 3 documentation (https://docs.python.org/3.5/library/time.html#time.strftime), but it doesn't actually do anything: >>> from time import strptime >>> strptime('+', '%z') == strptime('+0200', '%z') True

[issue23033] Disallow support for a*.example.net, *a.example.net, and a*b.example.net in certificate wildcard handling.

2017-04-02 Thread Christian Heimes
Christian Heimes added the comment: Ned, Benjamin, are you ok with a backport to 2.7 and 3.6? Substring (aka partial) matching of wildcards is a MAY feature according to RFC 6125 https://tools.ietf.org/html/rfc6125#section-6.4.3 . They are a violation of CA/B Form's baseline requirements, so

[issue27863] multiple issues in _elementtree module

2017-04-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 9c2c42c221d7996070c0c0a2a114ab42fe3ddb9d by Serhiy Storchaka in branch '2.7': bpo-27863: Fixed multiple crashes in ElementTree. (#765) (#903) (#963) https://github.com/python/cpython/commit/9c2c42c221d7996070c0c0a2a114ab42fe3ddb9d --

[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-04-02 Thread Andrew Nester
Andrew Nester added the comment: >From my perspective current behaviour is a bit frustrate that's why it would >be nice to have this issue fixed, but I would say it's critic one. At the same time it doesn't introduce any BC breaking changes and kind safe --

[issue27863] multiple issues in _elementtree module

2017-04-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1142 ___ Python tracker ___ ___

[issue15083] Rewrite ElementTree tests in a cleaner and safer way

2017-04-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7 ___ Python tracker

[issue15083] Rewrite ElementTree tests in a cleaner and safer way

2017-04-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 68903b656d4e1011525a46cbd1338c6cbab83d6d by Serhiy Storchaka in branch '2.7': bpo-15083: Convert ElementTree doctests to unittests. (#906) https://github.com/python/cpython/commit/68903b656d4e1011525a46cbd1338c6cbab83d6d --

[issue29416] Path.mkdir can get into a recursive error loop

2017-04-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___

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

2017-04-02 Thread R. David Murray
R. David Murray added the comment: Yes, the difficulty in renaming the parameter was why I suggested a doc change only. I'm not sure it it is worth it to go through a deprecation cycle for socketserver to change the name, though it certainly would be nice. Martin and I could make that

[issue29169] update zlib to 1.2.11

2017-04-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: -1029 ___ Python tracker ___

[issue29897] itertools.chain behaves strangly when copied with copy.copy

2017-04-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, this issue is tricky, and I don't have . If implement __copy__ for builtin compound iterators I would implement filter.__copy__ and map.__copy__ something like: def __copy__(self): cls, *args = self.__reduce__() return cls(*map(copy, args)) If

[issue29963] Remove obsolete declaration PyTokenizer_RestoreEncoding in tokenizer.h

2017-04-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good catch Jim! Seems the implementation was removed in Python 3. This is a private header, so no need to backport the change. -- nosy: +serhiy.storchaka stage: -> patch review type: -> enhancement ___ Python

[issue29963] Remove obsolete declaration PyTokenizer_RestoreEncoding in tokenizer.h

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

[issue29963] Remove obsolete declaration PyTokenizer_RestoreEncoding in tokenizer.h

2017-04-02 Thread Jim Fasarakis-Hilliard
New submission from Jim Fasarakis-Hilliard: Couldn't trace exactly when it was removed from tokenizer.c but the corresponding declaration in the header file survived. I'm not sure how to tag this small clean-up. -- messages: 291033 nosy: Jim Fasarakis-Hilliard priority: normal

[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2017-04-02 Thread Andre Merzky
Andre Merzky added the comment: This one might be related: https://bugs.python.org/issue27889 -- nosy: +Andre Merzky ___ Python tracker ___

[issue19225] lack of PyExc_BufferError doc

2017-04-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your patch Kinebuchi. Do you mind to backport it to other branches? -- stage: patch review -> backport needed ___ Python tracker

[issue19225] lack of PyExc_BufferError doc

2017-04-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset e8c763128fb459c5c98194e4312f31493c0f12df by Serhiy Storchaka (cocoatomo) in branch 'master': bpo-19225: Add a table of warning names and missed exception names in C API doc (#881)

[issue29654] SimpleHTTPRequestHandler should support browser cache

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

[issue29654] SimpleHTTPRequestHandler should support browser cache

2017-04-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 351adda54bed3afbbf6db7725699679e68722d7d by Serhiy Storchaka (Pierre Quentel) in branch 'master': bpo-29654 : Support If-Modified-Since HTTP header (browser cache) (#298)

[issue29897] itertools.chain behaves strangly when copied with copy.copy

2017-04-02 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: It is a tricky issue. How deep do you go?what if you are chaining several of the itertools? Seems like we're entering a semantic sinkhole here. Deepcopy would be too deep... The original copy support in these objects stems from the desire to support

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

2017-04-02 Thread Dominic Mayers
Dominic Mayers added the comment: I did not think very far when said that renaming the parameter could not possibly break the code ! Oh well ! But, renaming the parameter was not important in itself. It was to make the situation clearer and easier for those who write the documentation.

[issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher

2017-04-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 11fa3c7cd1b151e302d4eee0369cafbaf151c8fb by Benjamin Peterson (Michael Selik) in branch 'master': bpo-29957: change LBYL key lookup to dict.setdefault (#938) https://github.com/python/cpython/commit/11fa3c7cd1b151e302d4eee0369cafbaf151c8fb