[issue13886] readline-related test_builtin failure

2012-09-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13886 ___

[issue13888] test_builtin failure when run after test_tk

2012-09-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13888 ___

[issue15950] open() should not accept bool argument

2012-09-16 Thread Lars Gustäbel
New submission from Lars Gustäbel: Today I accidentally did this: open(True).read() Passing True as a file argument to open() does not fail, because a bool value is treated like an integer file descriptor (stdout in this case). Even worse is that the read() call hangs in an endless loop on

[issue15951] string.Formatter returns str for empty unicode template

2012-09-16 Thread Aleksey Sivokon
New submission from Aleksey Sivokon: Expected behavior of string.Formatter() is to return unicode strings for unicode templates, and byte strings for str templates. Which is exactly what it does, with one frustrating exception: for empty unicode string it returns byte str. Test follows:

[issue15951] string.Formatter returns str for empty unicode template

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: Adding failing test. Patch coming next. -- keywords: +patch nosy: +cjerdonek stage: - needs patch Added file: http://bugs.python.org/file27204/issue-15951-test-1.patch ___ Python tracker rep...@bugs.python.org

[issue11454] email.message import time

2012-09-16 Thread R. David Murray
R. David Murray added the comment: Considering how often that test is done, I would consider the compiled version of the short regex the clear winner based on your numbers. I wonder if we could precompile the regex and load it from a pickle. --

[issue15950] open() should not accept bool argument

2012-09-16 Thread R. David Murray
R. David Murray added the comment: I don't think so. We don't try to protect people from all their mistakes, and a file descriptor of 1 is valid, and True == 1. -- nosy: +r.david.murray resolution: - wont fix stage: - committed/rejected status: open - closed

[issue15951] string.Formatter returns str for empty unicode template

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: Here are some related failing cases that I found: f = string.Formatter() f.format(u{0}, ) '' f.format(u{0}, 1) '1' f.format(u{0}, a) 'a' f.format(u{0}{1}, a, b) 'ab' f.format({0}, ua) u'a' Note that PEP 3101 says the following: In all cases, the type

[issue15925] email.utils.parsedate(), email.utils.parsedate_tz() and email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2012-09-16 Thread R. David Murray
R. David Murray added the comment: Here is a patch. Georg, this unfortunately represents a regression from 3.2 and should be fixed. -- keywords: +patch stage: - commit review Added file: http://bugs.python.org/file27205/parsedate_invalid.patch ___

[issue15925] email.utils.parsedate(), email.utils.parsedate_tz() and email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2012-09-16 Thread R. David Murray
R. David Murray added the comment: Hmm. Not sure why Georg didn't get auto-added. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15925 ___

[issue15925] email.utils.parsedate() and email.utils.parsedate_tz() should return None when date cannot be parsed

2012-09-16 Thread R. David Murray
R. David Murray added the comment: Oh, and I'm purposely allowing parsedate_to_datetime throw exceptions. I suppose that should be documented, but that's a separate issue. -- title: email.utils.parsedate(), email.utils.parsedate_tz() and email.utils.parsedate_to_datetime() should

[issue15951] string.Formatter returns str for empty unicode template

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: Actually, I'm going to defer on creating a patch because this covers more scenarios than I originally thought and so may require more time. -- ___ Python tracker rep...@bugs.python.org

[issue15951] string.Formatter returns str for empty unicode template

2012-09-16 Thread R. David Murray
R. David Murray added the comment: Format with unicode is a bit of a mess in 2.7. It would be consistent with the rest of python2 for f.format({0}, ua) u'a' to be correct. See also issue 7300 and issue 15276. -- nosy: +eric.smith, r.david.murray

[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2012-09-16 Thread STINNER Victor
STINNER Victor added the comment: I prefer option (1), remove the buggy optimization. Python 3.3 does solve correctly this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5057 ___

[issue15951] string.Formatter returns str for empty unicode template

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: What about cases like this? f.format(u'{0}', '\xe9') '\xe9' It seems fixing this issue for non-empty strings would cause formerly running cases like this to raise UnicodeDecodeError. unicode('\xe9') ... UnicodeDecodeError: 'ascii' codec can't decode byte

[issue15695] Correct __sizeof__ support for StgDict

2012-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't know where StgDict used. Probably need to provide the correct __sizeof__ method for a mapping proxy behind which StgDict hidden. -- ___ Python tracker rep...@bugs.python.org

[issue15475] Correct __sizeof__ support for itertools

2012-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are there any objections? -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15475 ___ ___

[issue15490] Correct __sizeof__ support for StringIO

2012-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be good if someone looked at the patches. I'm not sure that they are good enough. Perhaps they are too complicated and we shouldn't worry about duplicates? -- ___ Python tracker rep...@bugs.python.org

[issue15796] Fix readline() docstrings

2012-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15796 ___ ___ Python-bugs-list mailing list

[issue15379] Charmap decoding of no-BMP characters

2012-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15379 ___ ___ Python-bugs-list mailing list

[issue15144] Possible integer overflow in operations with addresses and sizes.

2012-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please, Mark or some other C expert, can you do a code review for the patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15144 ___

[issue15490] Correct __sizeof__ support for StringIO

2012-09-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, I do think that it's not very important to make __sizeof__ strictly exact according to some specification. I'm also not sure we want to complicate maintenance when the calculation becomes tedious or difficult. To me __sizeof__ is mostly an educational

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: I can't yet reproduce on my system, but after looking at the code, I believe the following are closer to the cause: format(1, u'n') int.__format__(1, u'n') Incidentally, on my system, the following note in the docs is wrong: Note: format(value,

[issue15951] string.Formatter returns str for empty unicode template

2012-09-16 Thread R. David Murray
R. David Murray added the comment: Note that I didn't say it was correct, I just said it was consistent :) And no, breaking stuff that current works is a non-starter for 2.7. -- ___ Python tracker rep...@bugs.python.org

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Eric V. Smith
Eric V. Smith added the comment: The case with 1.__format__ is confusing the parser. It sees: floating point number 1. __format__ which is indeed a syntax error. Try: 1 .__format__(u'n') '1' or: (1).__format__(u'n') '1' --

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: The case with 1.__format__ is confusing the parser. Interesting, good catch! That error did seem unusual. The two modified forms do give the same result as int.__format__() (though the type still differs). --

[issue5057] Unicode-width dependent optimization leads to non-portable pyc file

2012-09-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5057 ___

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___

[issue15475] Correct __sizeof__ support for itertools

2012-09-16 Thread Georg Brandl
Georg Brandl added the comment: Certainly not for 3.3.0. I'm also not sure this counts as a bugfix in any case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15475 ___

[issue15952] format(value) and value.__format__() behave differently with unicode format

2012-09-16 Thread Chris Jerdonek
New submission from Chris Jerdonek: format(value) and value.__format__() behave differently even though the documentation says otherwise: Note: format(value, format_spec) merely calls value.__format__(format_spec). (from http://docs.python.org/library/functions.html?#format ) The difference

[issue15952] format(value) and value.__format__() behave differently with unicode format

2012-09-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15952 ___

[issue15951] string.Formatter returns str for empty unicode template

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: I filed issue 15952 for the behavior difference between format(value) and value.__format__() and the related lack of documentation re: unicode format strings. Given that the expected behavior for the current issue doesn't seem to be documented (aside from

[issue15475] Correct __sizeof__ support for itertools

2012-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Georg, sorry, I don't understood you. You have no objection to the inclusion of this patch in 3.3.0 or you say that this patch should not be in 3.3.0? -- ___ Python tracker rep...@bugs.python.org

[issue15475] Correct __sizeof__ support for itertools

2012-09-16 Thread Georg Brandl
Georg Brandl added the comment: Ah, sorry, that was unclear. I meant this is certainly not going into 3.3.0. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15475 ___

[issue15629] Add to regrtest the ability to run Lib and Doc doctests

2012-09-16 Thread Aaron Iles
Changes by Aaron Iles aaron.i...@gmail.com: -- nosy: +aliles ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15629 ___ ___ Python-bugs-list mailing

[issue12029] Catching virtual subclasses in except clauses

2012-09-16 Thread Andreas Stührk
Changes by Andreas Stührk andy-pyt...@hammerhartes.de: -- nosy: +Trundle ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12029 ___ ___

[issue15945] memoryview + bytes fails

2012-09-16 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: What is the expected outcome? memoryviews can't be resized, so this scenario isn't possible: The same as `view.tobytes() + bytes`, but without the extra copy implied by `view.tobytes()`. Just prepend the empty bytestring if you want to make sure the

[issue15945] memoryview + bytes fails

2012-09-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Or I could explicitly convert the memoryview to a bytes object. That strikes me as rather preferable. However, this defeats one use of memoryview, which is to avoid unnecessary copying. So it might be suitable workaround for some cases, but not all.

[issue15276] unicode format does not really work in Python 2.x

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: I did some analysis of this issue. For starters, I could not reproduce this on Mac OS X 10.7.4. I iterated through all available locales, and the separator was ASCII in all cases. Instead, I was able to fake the issue by changing , to \xa0 in the following

[issue15629] Add to regrtest the ability to run Lib and Doc doctests

2012-09-16 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: Added file: http://bugs.python.org/file27206/issue15629-3.2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15629 ___

[issue15920] make howto/regex.rst doctests pass

2012-09-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset f98f46f7f11b by Ezio Melotti in branch '3.2': #15920: fix doctests in Doc/howto/regex.rst. Patch by Chris Jerdonek. http://hg.python.org/cpython/rev/f98f46f7f11b New changeset ef44e1b740cb by Ezio Melotti in branch 'default': #15920: merge with

[issue15920] make howto/regex.rst doctests pass

2012-09-16 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the patch! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15920