[issue23096] Implementation-depended pickling floats with protocol 0

2014-12-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Python and C implementations of pickle produce different results when pickle floats with protocol 0. pickle.dumps(4.2, 0) b'F4.2002\n.' pickle._dumps(4.2, 0) b'F4.2\n.' -- components: Library (Lib) messages: 232992 nosy:

[issue23097] unittest can unnecessarily modify sys.path (and with the wrong case)

2014-12-21 Thread Chris Jerdonek
New submission from Chris Jerdonek: I have observed that when running unit tests using unittest's test discovery, unittest can simultaneously (1) modify sys.path unnecessarily (by adding a path that is already in sys.path with a different case), and (2) modify sys.path by adding a path of the

[issue23094] Unpickler failing with PicklingError at frame end on readline due to a broken comparison

2014-12-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file37521/pickle_frame_readline.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23094

[issue21279] str.translate documentation incomplete

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Patch v4 with John’s doc string wording -- Added file: http://bugs.python.org/file37522/issue21279.v4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21279

[issue23096] Implementation-depended pickling floats with protocol 0

2014-12-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python implementation uses repr(value) and C implementation uses '%.17g' % value. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23096 ___

[issue23094] Unpickler failing with PicklingError at frame end on readline due to a broken comparison

2014-12-21 Thread CensoredUsername
CensoredUsername added the comment: Indeed. In my case the problem was caused a subclassed Pickler which still used GLOBAL instead of STACK_GLOBAL in protocol 4. My own minimized test case was: data = b\x80\x04\x95\x11\x00\x00\x00\x00\x00\x00\x00cpickle\nPickler\n. pickletools.dis(data)

[issue23093] repr() on detached stream objects fails

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Here is patch v2, which ignores any exception derived from the Exception base class when reading the self.name etc properties. I’m interested what people think of this approach. -- Added file: http://bugs.python.org/file37523/detach-indep.v2.patch

[issue23093] repr() on detached stream objects fails

2014-12-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks reasonable to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23093 ___ ___ Python-bugs-list

[issue21279] str.translate documentation incomplete

2014-12-21 Thread John Posner
John Posner added the comment: Patch of 12-21 looks good, Martin. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21279 ___ ___ Python-bugs-list

[issue21279] str.translate documentation incomplete

2014-12-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed wording looks superfluously verbose to me. Look also at description in Include/unicodeobject.h: /* Translate a string by applying a character mapping table to it and return the resulting Unicode object. The mapping table must map Unicode

[issue22836] Broken Exception ignored in: message on exceptions in __repr__

2014-12-21 Thread R. David Murray
R. David Murray added the comment: See also issue 6294 for a related problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22836 ___ ___

[issue21279] str.translate documentation incomplete

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Serhiy can you point out which bits are too verbose? Perhaps you prefer it without the bullet list like in the earlier 2014-12-13 version of the patch. Looking at the C API, I see a couple problems there: * Omits mentioning that an ordinal can map to a

[issue6294] Improve shutdown exception ignored message

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Not sure what the original method to cause this message is. I’m guessing some code was trying to call a function that was set to None by the shutdown process, causing the exception message, and that repr() was also failing, causing the broken wording. Like

[issue23098] mknod devices can be 32 bits

2014-12-21 Thread Jesús Cea Avión
New submission from Jesús Cea Avión: Dan MacDonald told me that os.mknod() should accept devices 32 bits. I wrote this code in linux 64 bits: #include sys/types.h #include sys/stat.h #include fcntl.h #include unistd.h #include stdio.h int main(void) { printf(%d, sizeof(dev_t));

[issue22836] Broken Exception ignored in: message on exceptions in __repr__

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Patch v2 revises the unit tests so they are cleaner. Also now tests that the repr() failed placeholders are in the exception reports. -- Added file: http://bugs.python.org/file37524/unraisable-continue.v2.patch ___

[issue23093] repr() on detached stream objects fails

2014-12-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset f3ff3e424b6f by Benjamin Peterson in branch '3.4': allow more operations to work on detached streams (closes #23093) https://hg.python.org/cpython/rev/f3ff3e424b6f New changeset afa8d8ab0937 by Benjamin Peterson in branch '2.7': allow more

[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2014-12-21 Thread Martin Panter
Martin Panter added the comment: [Edit Error: 'utf8' codec can't decode byte 0xe2 in position 212: invalid continuation byte] Re-reading the suggested description, it struck me that for encoding, this is redundant with the “backslashreplace” error handler: test = .join(map(chr,

[issue23061] Update pep8 to specify explicitly 'module level' imports at top of file

2014-12-21 Thread Ian Lee
Ian Lee added the comment: So one concern that was brought up on GitHub was the fact that currently this is not actually followed universally in the Python standard library. In particular there are 636 errors in the standard library ``python pep8.py --select E402 --statistics

[issue23061] Update pep8 to specify explicitly 'module level' imports at top of file

2014-12-21 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23061 ___ ___

[issue23061] Update pep8 to specify explicitly 'module level' imports at top of file

2014-12-21 Thread Ian Lee
Ian Lee added the comment: I should add that I would be happy to patch the standard libraries to be compliant w.r.t. the imports at top of the files. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23061

[issue21279] str.translate documentation incomplete

2014-12-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Serhiy can you point out which bits are too verbose? Perhaps you prefer it without the bullet list like in the earlier 2014-12-13 version of the patch. I prefer it without the bullet list and without LookupError expansion (there is a link to LookupError