[issue13886] readline-related test_builtin failure

2012-09-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue13888] test_builtin failure when run after test_tk

2012-09-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[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 my

[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: imp

[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

[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}", u"a") u'a' Note that PEP 3101 says the

[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 ___ ___ P

[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 retu

[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 _

[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}", u"a") 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 ___ __

[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

[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 __

[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 ___ ___ Python-bugs-list maili

[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

[issue15796] Fix readline() docstrings

2012-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue15379] Charmap decoding of no-BMP characters

2012-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[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 ___ ___

[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 to

[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(valu

[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

[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: __format__ which is indeed a syntax error. Try: >>> 1 .__format__(u'n') '1' or: >>> (1).__format__(u'n') '1' -- ___ Python tracker

[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 : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[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 : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[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 ___ ___

[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 : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[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 PEP

[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

[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 ___

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

2012-09-16 Thread Aaron Iles
Changes by Aaron Iles : -- nosy: +aliles ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue12029] Catching virtual subclasses in except clauses

2012-09-16 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[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 r

[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. I

[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 followi

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

2012-09-16 Thread Ezio Melotti
Changes by Ezio Melotti : Added file: http://bugs.python.org/file27206/issue15629-3.2.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[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 3.2

[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 ___

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

2012-09-16 Thread Ezio Melotti
Ezio Melotti added the comment: We discussed about this on IRC, and I'll try to summarize the outcomes. If we want devs to run doctests, the syntax should be as simple as possible, ideally there shouldn't be any extra syntax -- at least for the common case. Note that there are two kind of doct

[issue11643] Use |version| instead of X.Y in the doc

2012-09-16 Thread Mike Hoy
Changes by Mike Hoy : -- nosy: +mikehoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue11643] Use |version| instead of X.Y in the doc

2012-09-16 Thread Mike Hoy
Mike Hoy added the comment: So we could fix this in reverse? Remove the |version| and replace them with X.Y since |version| doesn't expand within :file:? -- ___ Python tracker _

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

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: Eric, it looks like you wrote this comment: /* don't define FORMAT_LONG, FORMAT_FLOAT, and FORMAT_COMPLEX, since we can live with only the string versions of those. The builtin format() will convert them to unicode. */ in http://hg.python.org/cpython/fil

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

2012-09-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: See this code comment: /* don't define FORMAT_LONG, FORMAT_FLOAT, and FORMAT_COMPLEX, since we can live with only the string versions of those. The builtin format() will convert them to unicode. */ from http://hg.python.org/cpython/file/19601d451d4c/Pyth

[issue15419] distutils: build should use a version-specific build directory

2012-09-16 Thread Ronald Oussoren
Ronald Oussoren added the comment: I don't think this is a bugfix, but a new feature and as such the behavior should only be changed for 3.4. The easiest workaround for this issue is to use setuptools or distribute when installing, as those tools do set the various build directories to versio