[issue2142] difflib.unified_diff(...) produces invalid patches

2015-11-04 Thread Evgeny Kapun
Changes by Evgeny Kapun : -- nosy: +abacabadabacaba ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue25550] RecursionError in re with '(' * 500

2015-11-04 Thread Florian Bruhin
New submission from Florian Bruhin: I just found this thanks to Hypothesis[1]: >>> import re >>> re.compile('(' * 500) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/re.py", line 224, in compile return _compile(pattern, flags)

[issue25545] email.message.get_payload returns wrong encoding

2015-11-04 Thread Christian Tanzer
Christian Tanzer added the comment: R. David Murray wrote at Tue, 03 Nov 2015 19:59:53 +: > Your problem is that your input email is ia unicode string. A unicode > string has no RFC defintion as an email, so things do not work right, > as you observed. Whether or not email should throw

[issue25550] RecursionError in re with '(' * 500

2015-11-04 Thread SilentGhost
Changes by SilentGhost : -- components: +Regular Expressions nosy: +mrabarnett versions: +Python 3.6 ___ Python tracker ___ ___ Python

[issue25550] RecursionError in re with '(' * 500

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This isn't a bug, this is a limitation of the implementation. Regular expression parser is recursive and Python has a limit for recursion depth. You can increase this limit if needed. >>> import sys, re >>> sys.setrecursionlimit(2000) >>> re.compile('(' * 50

[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-11-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Here is patch with a subdued message to see Help when IDLE Dark is selected. It goes away when something else is selected. I tried no emphasis, colored background, relief, and the dull red text in the patch. I tested, but I want to retest systematically when

[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-11-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: I also want to document new Current Theme in docstring and maybe comments for future readers. -- ___ Python tracker ___ ___

[issue25498] Python 3.4.3 core dump with simple sample code

2015-11-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: serhiy.storchaka -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue25550] RecursionError in re with '(' * 500

2015-11-04 Thread Florian Bruhin
Florian Bruhin added the comment: I see how it's not possible to compile that pattern as it's using recursion - I don't mind that. However, I think this should be handled and re-raised as a re.error ("Exception raised [...] when some other error occurs during compilation or matching."). I thi

[issue25061] Add native enum support for argparse

2015-11-04 Thread desbma
desbma added the comment: I guess the question is whether Enum should be considered a first class 'native' type that deserves support in argparse, or just a tool among others in the stdlib. The fact that Enum is implemented as a class, and lives in a module, tends to lead to the second, but t

[issue25539] python3 fail on parsing http header

2015-11-04 Thread Martin Panter
Martin Panter added the comment: Just noticed the whitespace scenario is mentioned at : ''' No whitespace is allowed between the header field-name and colon. In the past, differences in the handling of such whitespace have led to security vu

[issue25539] python3 fail on parsing http header

2015-11-04 Thread Shin Dong-won
Shin Dong-won added the comment: Yeah, this is server's fault and python does not have to deal with non-standard cases. I'll close this issue. Thanks! -- status: open -> closed ___ Python tracker _

[issue5550] [urllib.request]: Comparison of HTTP headers should be insensitive to the case

2015-11-04 Thread Martin Panter
Martin Panter added the comment: Regarding the original bug reported by Cocobear, I think this is by design. The “addheaders” attribute seems to serve as a set of default header fields, although this is hardly obvious from the documentation. In fact the current documentation suggests you have

[issue25521] optparse module does not emit DeprecationWarning

2015-11-04 Thread John Hagen
John Hagen added the comment: Is there any consensus on how to move forward with this? I feel there are at least 4 options: 1) Do nothing. Pro: No work. Con: It feels misleading to the user since the docs clearly state it's deprecated. Some users (especially new ones) may miss the fa

[issue24802] int and float constructing from non NUL-terminated buffer

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I prefer to merge issue24802 and issue24803 and discuss them at one place. Here is merged and revised patch. The patch is changed. There is a very rare corner case: when the type of argument is a subclass of bytes or bytearray with overloaded tp_as_buffer->

[issue24803] PyNumber_Long Buffer Over-read.patch

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Merged with issue24802. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue23760] Tkinter in Python 3.4 on Windows don't post internal clipboard data to the Windows clipboard on exit

2015-11-04 Thread Jon Snoo
Jon Snoo added the comment: I tested the code posted by Victor with Python 3.5 (which uses Tcl/Tk 8.6.4) and I still get an empty clipboard when the script exits. I also downloaded ActiveState's Tcl binary which is also version 8.6.4, and tested the minimal reproducer posted by Serhiy with thi

[issue23760] Tkinter in Python 3.4 on Windows don't post internal clipboard data to the Windows clipboard on exit

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Related Tk issues: http://core.tcl.tk/tk/tktview/822002ff http://core.tcl.tk/tk/tktview/732662ff http://core.tcl.tk/tk/tktview/1844034f http://core.tcl.tk/tk/tktview/939389ff The problem should be fixed (at leas

[issue25539] python3 fail on parsing http header

2015-11-04 Thread R. David Murray
R. David Murray added the comment: Support for handling such headers could be added to the new email API (ie: add a policy setting to accept them), if someone wants to make a feature request. -- nosy: +r.david.murray ___ Python tracker

[issue25549] call sum on list of timedelta throws TypeError

2015-11-04 Thread R. David Murray
R. David Murray added the comment: I don't think this warrants a special error message. If you get it, it is obvious you weren't yourself adding an int to a timedelta, so the next logical course of action should be to look at the docs for sum. -- nosy: +r.david.murray resolution: ->

[issue25545] email parsing docs need to be clear that only ASCII strings are supported

2015-11-04 Thread R. David Murray
R. David Murray added the comment: There is no problem with supporting both 2.7 and python3 with the same email API as long as your input strings are ASCII only, which is what is required by the email RFCs (as I said, they do not support unicode...even the new one only supports utf8 (a unicode

[issue25521] optparse module does not emit DeprecationWarning

2015-11-04 Thread R. David Murray
R. David Murray added the comment: I vote for (4): (2) with a helping of (3). That is, add the warning, but don't try to port all the stdlib modules to argparse beforehand. Those should be addressed one by one, as I mentioned in another issue. --

[issue25550] RecursionError in re with '(' * 500

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: re.compile can also raise ValueError and OverflowError. Agree that may be these exceptions can be converted to re.error. But it can also raise MemoryError, and KeyboardInterrupt. And these exceptions can't be converted to re.error. RecursionError is closer

[issue25521] optparse module does not emit DeprecationWarning

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I vote for gradual porting stdlib modules and scripts to argparse and fixing found problems, but doesn't touch optparse right now. We have enough time before 3.6 feature freezing. -- ___ Python tracker

[issue25521] optparse module does not emit DeprecationWarning

2015-11-04 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: +1 with @serhiy.storchaka -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23883] __all__ lists are incomplete

2015-11-04 Thread Michael Selik
Michael Selik added the comment: many things are not present in os.__all__ that should be, including os.getcwd -- nosy: +selik ___ Python tracker ___

[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-11-04 Thread Eric Snow
Eric Snow added the comment: Review posted. Aside from a couple minor comments, LGTM. Thanks for doing this. Incidentally, it should be possible to auto-detect independent changes to the underlying dict and sync the odict with those changes. However, doing so likely isn't worth it.

[issue25061] Add native enum support for argparse

2015-11-04 Thread paul j3
paul j3 added the comment: The choice of 'type' for this parameter is occasionally confusing, because the connection to the Python 'type()' function or what we think of as 'native types' is only tangential. A name like 'converter' or 'string_converter' would be more accurate (but I'm not advo

[issue25545] email parsing docs need to be clear that only ASCII strings are supported

2015-11-04 Thread Christian Tanzer
Christian Tanzer added the comment: R. David Murray wrote at Wed, 04 Nov 2015 15:36:27 +: > There is no problem with supporting both 2.7 and python3 with the same > email API as long as your input strings are ASCII only, which is what > is required by the email RFCs (as I said, they do not s

[issue25545] email parsing docs need to be clear that only ASCII strings are supported

2015-11-04 Thread R. David Murray
R. David Murray added the comment: Yes, the port from python2 to python3 of the email package was...suboptimal. (I wasn't a contributor when that happened, and the person who did it simply did not have time to do the needed rewrite...he had to settle for just making it more-or-less work.) The

[issue25449] Test OrderedDict subclass

2015-11-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 499398d91b97 by Serhiy Storchaka in branch '3.5': Issue #25449: Iterating OrderedDict with keys with unstable hash now raises https://hg.python.org/cpython/rev/499398d91b97 New changeset 9db4191723eb by Serhiy Storchaka in branch 'default': Issue #2

[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-11-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 88d97cd99d16 by Serhiy Storchaka in branch '3.5': Issue #24726: Fixed issue number for previous changeset 59c7615ea921. https://hg.python.org/cpython/rev/88d97cd99d16 New changeset 965109e81ffa by Serhiy Storchaka in branch 'default': Issue #24726:

[issue25449] Test OrderedDict subclass

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 59c7615ea921 and 76e848554b5d were related to issue24726. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks for your review Eric. test_delitem_2 was not added because it fails in just added TestCase for COrderedDict subclass. Added tests for direct calls of other dict methods as Eric suggested. During writing new tests for direct calls of other dict method

[issue25410] Clean up and fix OrderedDict

2015-11-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please make a review of last three patches Eric? -- ___ Python tracker ___ ___ Python-bu

[issue24934] django_v2 benchmark not working in Python 3.6

2015-11-04 Thread R. David Murray
R. David Murray added the comment: An additional argument for waiting is issue 25486. -- type: crash -> behavior ___ Python tracker ___ __

[issue25551] Event's test_reset_internal_locks too fragile

2015-11-04 Thread Nir Soffer
New submission from Nir Soffer: test_reset_internal_locks is looking at Event's _cond._lock - this make it harder to change internal details of the Condition object and make the test fragile. We should test the condition behavior instead. -- components: Tests messages: 254074 nosy: ni

[issue25551] Event's test_reset_internal_locks too fragile

2015-11-04 Thread Nir Soffer
Changes by Nir Soffer : -- keywords: +patch Added file: http://bugs.python.org/file40941/0001-Issue-254074-Test-condition-behavior-instead-of-inte.patch ___ Python tracker ___ _

[issue25410] Clean up and fix OrderedDict

2015-11-04 Thread Eric Snow
Eric Snow added the comment: I will review those patches soon. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue23571] Raise SystemError if a function returns a result with an exception set

2015-11-04 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue24802] int and float constructing from non NUL-terminated buffer

2015-11-04 Thread Martin Panter
Martin Panter added the comment: The patch looks good to me. However I don’t understand what you meant about restoring int(bytes, base) behaviour. None of the patches here, nor in Issue 22896, touch long_new() in /Objects/longobject.c. -- nosy: +martin.panter

[issue24802] int and float constructing from non NUL-terminated buffer

2015-11-04 Thread Martin Panter
Martin Panter added the comment: Going through the commits for Issue 22896, I noticed compile(), eval() and exec() also suffer from a similar flaw. They check strlen(buffer) but the buffer may not be null-terminated: >>> eval(memoryview(b"1234")[1:3]) TypeError: source code string cannot conta

[issue25552] python turtle page does not run

2015-11-04 Thread Anthony C
New submission from Anthony C: Making this simple code to mess with turtle well it seems like after awhile I have encountered the window = turtle.Screen() doesnt seem to even open it up only the shell window and does nothing afterwards. Its quite annoying especially trying to practice with it

[issue24802] int and float constructing from non NUL-terminated buffer

2015-11-04 Thread Martin Panter
Martin Panter added the comment: This patch builds on Serhiy’s, and also fixes compile(), eval() and exec(). Also, I took the liberty of converting your assertRaises() calls to assertRaisesRegex() with context managers. I find this is a good general practice, to avoid hiding an accidental exce

[issue23883] __all__ lists are incomplete

2015-11-04 Thread Martin Panter
Martin Panter added the comment: Michael: According to Issue 18554, os.__all__ was fixed in 3.5. Can you confirm? It is working for me: Python 3.5.0 (default, Sep 20 2015, 11:28:25) [GCC 5.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> "g

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-04 Thread Xiang Zhang
Xiang Zhang added the comment: I'm afraid we can't say negative epoch is handled successfully on Linux. Use $ touch -d "1 Jan 1900" test as a test, time.gmtime(os.fstat(f.fileno()).st_mtime) gives time.struct_time(tm_year=1899, tm_mon=12, tm_mday=31, tm_hour=15, tm_min=54, tm_sec=17, tm_wday=6

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-04 Thread Martin Panter
Martin Panter added the comment: Perhaps you have a timezone set (I don’t). This might work better: touch -d "1 Jan 1900 UTC" test My thinking is if os.stat() returns a negative timestamp from the OS (GNU C library in the case of Linux), it may be worth trying gmtime() on that value since it

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-04 Thread Xiang Zhang
Xiang Zhang added the comment: You're right. Actually I do think of timezone when I do the experiment. But I think different timezone will only affect the hour. It turns out I should learn more about time. -- ___ Python tracker

[issue23883] __all__ lists are incomplete

2015-11-04 Thread Michael Selik
Michael Selik added the comment: @Martin, my mistake. You're correct. I forgot I was using Python v3.4. -- ___ Python tracker ___ ___

[issue5550] [urllib.request]: Comparison of HTTP headers should be insensitive to the case

2015-11-04 Thread Martin Panter
Martin Panter added the comment: The patch here does the same thing as John’s issue2775.patch in Issue 2275. I am closing this thread, because I think John’s patch in the other one is superior (except for being way out of date). -- resolution: -> duplicate status: open -> closed super

[issue25553] SMTP.data(msg) function may cause the last CRLF of msg lost if msg is quoted-printable encoding.

2015-11-04 Thread Deli Zhang
New submission from Deli Zhang: It's well known that in quoted-printable encoding the "CRLF" can be encoded to "=CRLF". For example, in attachment file test.eml, the last line is "test message.=CRLF" But after the mail is sent via SMTP and received by mail server (e.g. postfix), the last line w

[issue5550] [urllib.request]: Comparison of HTTP headers should be insensitive to the case

2015-11-04 Thread Martin Panter
Changes by Martin Panter : -- superseder: Implement PEP 3108 -> urllib/httplib header capitalization ___ Python tracker ___ ___ Python-

[issue25553] SMTP.data(msg) function may cause the last CRLF of msg lost if msg is quoted-printable encoding.

2015-11-04 Thread Deli Zhang
Deli Zhang added the comment: Correct the action of appending the end-of-data sequence "." -- Added file: http://bugs.python.org/file40945/smtplib.py ___ Python tracker ___ _

[issue2275] Make urllib.request.Request.has_header() etc case-insensitive

2015-11-04 Thread Martin Panter
Martin Panter added the comment: Rui: See Issue 12455 about changing the letter case of field names sent to the server. Unless someone wants to write a patch to fix all the bugs at once, I suggest to keep this thread focussed on Request.has_header() etc. I closed Issue 5550 as a duplicate of t

[issue12978] Figure out extended attributes on BSDs

2015-11-04 Thread William Orr
William Orr added the comment: After a considerable amount of rework, I've gotten something worth submitting. All unit tests pass, and it handles some of the more unfortunate differences between FreeBSD's extended attribute syscalls and Linux's. One of the bigger changes is that I reworked the

[issue12612] Valgrind suppressions

2015-11-04 Thread Marius Gedminas
Marius Gedminas added the comment: Could this fix be backported to the 2.7 branch as well? -- nosy: +mgedmin ___ Python tracker ___ __