[issue13886] readline-related test_builtin failure
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13886 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13888] test_builtin failure when run after test_tk
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13888 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15950] open() should not accept bool argument
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 linux box. On windows I get an EBADF at least. Wouldn't it be better if open() checked explicitly for a bool argument and raises a TypeError? -- components: IO messages: 170550 nosy: lars.gustaebel priority: normal severity: normal status: open title: open() should not accept bool argument type: behavior versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15950 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15951] string.Formatter returns str for empty unicode template
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: import string template = u result = string.Formatter().format(template) assert isinstance(result, unicode) # AssertionError -- components: Library (Lib) messages: 170551 nosy: Aleksey.Sivokon priority: normal severity: normal status: open title: string.Formatter returns str for empty unicode template type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15951] string.Formatter returns str for empty unicode template
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 http://bugs.python.org/issue15951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11454] email.message import time
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. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15950] open() should not accept bool argument
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15950 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15951] string.Formatter returns str for empty unicode template
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 of the format string dominates - that is, the result of the conversion will always result in an object that contains the same representation of characters as the input format string. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15925] email.utils.parsedate(), email.utils.parsedate_tz() and email.utils.parsedate_to_datetime() should return None when date cannot be parsed
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15925 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15925] email.utils.parsedate(), email.utils.parsedate_tz() and email.utils.parsedate_to_datetime() should return None when date cannot be parsed
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15925] email.utils.parsedate() and email.utils.parsedate_tz() should return None when date cannot be parsed
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 return None when date cannot be parsed - email.utils.parsedate() and email.utils.parsedate_tz() should return None when date cannot be parsed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15925 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15951] string.Formatter returns str for empty unicode template
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 http://bugs.python.org/issue15951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15951] string.Formatter returns str for empty unicode template
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5057] Unicode-width dependent optimization leads to non-portable pyc file
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15951] string.Formatter returns str for empty unicode template
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 0xe9 in position 0: ordinal not in range(128) Would that be acceptable? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15695] Correct __sizeof__ support for StgDict
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 http://bugs.python.org/issue15695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15475] Correct __sizeof__ support for itertools
Serhiy Storchaka added the comment: Are there any objections? -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15475 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15490] Correct __sizeof__ support for StringIO
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 http://bugs.python.org/issue15490 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15796] Fix readline() docstrings
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15796 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15379] Charmap decoding of no-BMP characters
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15379 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15144] Possible integer overflow in operations with addresses and sizes.
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15490] Correct __sizeof__ support for StringIO
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 tool which gives a hint at the memory impact of an object, but cannot really convey a precise information except for trivial atomic types. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15490 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15276] unicode format does not really work in Python 2.x
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, format_spec) merely calls value.__format__(format_spec). (from http://docs.python.org/library/functions.html?#format ) format(1, u'n') u'1' 1.__format__(u'n') File stdin, line 1 1.__format__(u'n') ^ SyntaxError: invalid syntax int.__format__(1, u'n') '1' Observe also that format() and int.__format__() return different types. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15951] string.Formatter returns str for empty unicode template
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 http://bugs.python.org/issue15951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15276] unicode format does not really work in Python 2.x
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' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15276] unicode format does not really work in Python 2.x
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). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5057] Unicode-width dependent optimization leads to non-portable pyc file
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15276] unicode format does not really work in Python 2.x
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15475] Correct __sizeof__ support for itertools
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15952] format(value) and value.__format__() behave differently with unicode format
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 happens when the format string is unicode. For example: format(10, u'n') u'10' (10).__format__(u'n') # parentheses needed to prevent SyntaxError '10' So either the documentation should be changed, or the behavior should be changed to match. Related to this: neither the Format Specification Mini-Language documentation nor the string.Formatter docs seem to say anything about the effect that a unicode format string should have on the return value (in particular, should it cause the return value to be unicode or not): http://docs.python.org/library/string.html#formatspec http://docs.python.org/library/string.html#string-formatting See also issue 15276 (int formatting), issue 15951 (empty format string), and issue 7300 (unicode arguments). -- assignee: docs@python components: Documentation messages: 170575 nosy: cjerdonek, docs@python priority: normal severity: normal status: open title: format(value) and value.__format__() behave differently with unicode format type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15952 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15952] format(value) and value.__format__() behave differently with unicode format
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15952 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15951] string.Formatter returns str for empty unicode template
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 3101, which is probably too late to follow), we should probably agree on what the behavior should be (as well as documenting it) before or while addressing this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15475] Correct __sizeof__ support for itertools
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 http://bugs.python.org/issue15475 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15475] Correct __sizeof__ support for itertools
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15629] Add to regrtest the ability to run Lib and Doc doctests
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 list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12029] Catching virtual subclasses in except clauses
Changes by Andreas Stührk andy-pyt...@hammerhartes.de: -- nosy: +Trundle ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12029 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15945] memoryview + bytes fails
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 result is a bytes object: 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. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15945 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15945] memoryview + bytes fails
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. Indeed, that's why I think it would be good to fix the bytes.join() method (which is precisely meant to minimize copying and resizing). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15945 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15276] unicode format does not really work in Python 2.x
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 line-- http://hg.python.org/cpython/file/820032281f49/Objects/stringlib/formatter.h#l651 and then reproduce with: u'{:,}'.format(1) .. UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 2: ordinal not in range(128) format(1, u',') .. UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 2: ordinal not in range(128) However, note this difference (see also issue 15952)-- (1).__format__(u',') '10\xa' The issue seems to be that PyObject_Format() in Objects/abstract.c (which, unlike int__format__() in Objects/intobject.c, does respect whether the format string is unicode or not) calls int__format__() to get the formatted string as a byte string. It then passes this to PyObject_Unicode() to convert to unicode. This in turn calls PyUnicode_FromEncodedObject() with a NULL encoding, which causes that code to use PyUnicode_GetDefaultEncoding() for the encoding (i.e. sys.getdefaultencoding()). The right way to fix this seems to be to make int__format__() return unicode as appropriate, which may mean modifying formatter.h's format_int_or_long_internal() to return unicode -- as well as taking into account the locale encoding when accessing the locale's thousands separator. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15276 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15629] Add to regrtest the ability to run Lib and Doc doctests
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15920] make howto/regex.rst doctests pass
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. http://hg.python.org/cpython/rev/ef44e1b740cb New changeset 19601d451d4c by Ezio Melotti in branch '2.7': #15920: fix doctests in Doc/howto/regex.rst. Patch by Chris Jerdonek. http://hg.python.org/cpython/rev/19601d451d4c -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15920 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15920] make howto/regex.rst doctests pass
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com