[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2014-04-22 Thread paul j3
paul j3 added the comment: http://bugs.python.org/issue15112 breaks one test that I added to issue +class TestPositionalsAfterOptionalsPlus(ParserTestCase): +Tests specifying a positional that follows an arg with nargs=+ +http://bugs.python.org/issue9338#msg111270 +

[issue6305] islice doesn't accept large stop values

2014-04-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: The first patch was cleaner. I don't think it is necessary to start-fast and switch-to-slow in the case where not all of the arguments are in the normal range. -- ___ Python tracker rep...@bugs.python.org

[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: The ref-counts in the islice_reduce code don't look to be correct at first glance. -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21321

[issue21320] dict() allows keyword expansion with integer keys, e.g. dict(**{5:'v'})

2014-04-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: IIRC, we've only created -3 warnings for things that would be incorrectly accepted by Python 3 (such as floor division using /). I don't think that applies here and isn't worth monkeying with Py2.7. It goes in the harmless nuisance category, something

[issue21326] asyncio: request clearer error message when event loop closed

2014-04-22 Thread Mark Dickinson
New submission from Mark Dickinson: In the new asyncio library, it's easy for newbies (like me) to accidentally try to run a coroutine on a closed event loop. Doing so leads to a rather inscrutable exception and traceback: loop.run_until_complete(compute()) Traceback (most recent call

[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-22 Thread Iñigo Serna
Iñigo Serna added the comment: Mainly, 2 reasons: - It can make programs crash *unexpectedly* - Pathlib should provide a complete and uniform API for dealing with all types of files. If not, users would need to use Pathlib for some kind of files and go to os and os.path for others, then why

[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: - It can make programs crash *unexpectedly* A broken link is an error, so it's normal to have an exception raised here. An exception can always be caught if you were expecting the error. - Pathlib should provide a complete and uniform API for dealing with

[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: FWIW: I don't think we need to manage the news entries in the NEWS file. Instead, we could simply add a field to the bug tracker called news entry and populate that as necessary. During release, this information can then be used to create a NEWS file per

[issue21256] Sort keyword arguments in mock _format_call_signature

2014-04-22 Thread Michael Foord
Michael Foord added the comment: I agree with Antoine's review comments. With those changes in place, ok to commit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21256 ___

[issue21327] socket.type value changes after using settimeout()

2014-04-22 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola': s = socket.socket() s.type SocketType.SOCK_STREAM: 1 s.settimeout(2) s.type 2049 I can reproduce this with Python 3.5, 3.4 and 3.3. 2.7 is not affected. -- messages: 216999 nosy: giampaolo.rodola priority: normal severity: normal status:

[issue21327] socket.type value changes after using settimeout()

2014-04-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: It seems this was introduced in issue 7523 / revision 12442ac3f7dd. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___

[issue21327] socket.type value changes after using settimeout()

2014-04-22 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- Removed message: http://bugs.python.org/msg217001 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21327 ___

[issue21327] socket.type value changes after using settimeout()

2014-04-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Generally speaking I think it's fine to have this behavior only if the socket object is instantiated like this: s = socket.socket(type=socket.SOCK_STREAM | socket.SOCK_NONBLOCK) s.type 2049 ...but when it comes to using setblocking() I would not expect

[issue21327] socket.type value changes after using settimeout()

2014-04-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Generally speaking I think it's fine to have this behavior only if the socket object is instantiated like this: s = socket.socket(type=socket.SOCK_STREAM | socket.SOCK_NONBLOCK) s.type 2049 ...but when it comes to using settimeout() I would not expect

[issue6305] islice doesn't accept large stop values

2014-04-22 Thread Alok Singhal
Alok Singhal added the comment: OK. Here is the first patch with a couple of bug fixes for slow mode. -- Added file: http://bugs.python.org/file34999/islice_large_values-3.patch ___ Python tracker rep...@bugs.python.org

[issue20147] multiprocessing.Queue.get() raises queue.Empty exception if even if an item is available

2014-04-22 Thread Alexei Mozhaev
Alexei Mozhaev added the comment: We have a similar bug with Queue.get(). Queue.get(False) raises an exception Queue.Empty in the case when the queue is actually not empty! An example of the code is attached and is listed below just in case: -- import multiprocessing

[issue21328] Resize doesn't change reported length on create_string_buffer()

2014-04-22 Thread Dustin Oprea
New submission from Dustin Oprea: The memory is resized, but the value returned by len() doesn't change: b = ctypes.create_string_buffer(23) len(b) 23 b.raw = '0' * 23 b.raw = '0' * 24 Traceback (most recent call last): File stdin, line 1, in module ValueError: string too long

[issue21255] Attaching a PropertyMock records calls

2014-04-22 Thread Michael Foord
Michael Foord added the comment: Not sure, but I guess it would be easy to find out. It will need some digging into to find out where the actual bug is. It shouldn't be hard to find though. -- ___ Python tracker rep...@bugs.python.org

[issue21326] asyncio: request clearer error message when event loop closed

2014-04-22 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I've never hear from someone who did this before. It might be easy to fix, but it would be ugly too (every EventLoop method would have to check this), and not very useful (you'll only make this mistake once in your life). How much time did you waste

[issue21326] asyncio: request clearer error message when event loop closed

2014-04-22 Thread Mark Dickinson
Mark Dickinson added the comment: Maybe we can just change repr(loop) to make it clear that it's closed? That sounds good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21326 ___

[issue21326] asyncio: request clearer error message when event loop closed

2014-04-22 Thread Mark Dickinson
Mark Dickinson added the comment: How much time did you waste debugging this? Not much: less than 5 minutes. While I *probably* won't make this mistake again (though I'm not going to make any promises on that front), it would be nice to prevent other people from doing so. More info: I got

[issue21138] mimetypes.MimeType UnicodeDecodeError

2014-04-22 Thread Tim Golden
Tim Golden added the comment: This looks like a duplicate of issue9291; could you test the latest patch over there, please? -- assignee: - tim.golden nosy: +tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21138

[issue21325] Missing Generic EXIF library for images in the standard library

2014-04-22 Thread Brett Cannon
Brett Cannon added the comment: A guide on how to get a module added to the stdlib can be found at https://docs.python.org/devguide/stdlibchanges.html#adding-a-new-module , although I think an EXIF module is going to be too niche to ever be accepted. -- nosy: +brett.cannon

[issue21329] configparser can't parse MySQL style config

2014-04-22 Thread Daniël van Eeden
New submission from Daniël van Eeden: With Python 2.7 the ConfigParser was enriched with the allow_no_value option which resulted in a much more usable configparser for MySQL configs. It can now parse configs like this: [mysqld] log_bin innodb_file_per_table innodb_io_capacity=800 However it

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-22 Thread Zachary Ware
Zachary Ware added the comment: 8.5.15 sounds good to me; here's the patch to 2.7 once the 8.5.15 sources are on svn.python.org as tcl-8.5.15.0 and tk-8.5.15.0, no modifications necessary. -- keywords: +patch Added file: http://bugs.python.org/file35002/issue21303-2.7-tcl-upgrade.diff

[issue21328] Resize doesn't change reported length on create_string_buffer()

2014-04-22 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21328 ___ ___

[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-22 Thread Anton Afanasyev
Anton Afanasyev added the comment: Hi Raymond, do you mean allocation exceptions handling should be more accurate? Attaching fixed version for 3.4 branch. -- Added file: http://bugs.python.org/file35003/issue21321_3.4_8c8315bac6a8_2.diff ___ Python

[issue20147] multiprocessing.Queue.get() raises queue.Empty exception if even if an item is available

2014-04-22 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20147 ___ ___ Python-bugs-list mailing list

[issue17552] socket.sendfile()

2014-04-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Yet another patch fixing some problems on Windows. Hopefully this should be the last one as for what concerns the POSIX systems. As such I would kindly ask for a review and/or further suggestions. -- Added file:

[issue21329] configparser can't parse MySQL style config

2014-04-22 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +lukasz.langa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21329 ___ ___ Python-bugs-list mailing

[issue21330] Typo in Unicode HOWTO documentation

2014-04-22 Thread Jayanth Raman
New submission from Jayanth Raman: It should be 128 such characters in the following sentence: For example, you can’t fit both the accented characters used in Western Europe and the Cyrillic alphabet used for Russian into the 128-255 range because there are more than 127 such characters.

[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2014-04-22 Thread Mike Mazurek
Mike Mazurek added the comment: In building pycrypto for python 3.4 I applied patch msvccompiler9_33.diff. After applying the patch there is an unassigned variable: KEY_BASE on line 67 of the patched file. After setting KEY_BASE = Software\\Wow6432Node\\Microsoft\\ before its first use I was

[issue6721] Locks in python standard library should be sanitized on fork

2014-04-22 Thread Forest Bond
Changes by Forest Bond for...@alittletooquiet.net: -- nosy: +forest_atq ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6721 ___ ___

[issue20565] Update Tcl/Tk version for buildbots

2014-04-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2b8d9276ad5b by Zachary Ware in branch '2.7': Issue #21303, #20565: Updated the version of Tcl/Tk used on Windows http://hg.python.org/cpython/rev/2b8d9276ad5b -- nosy: +python-dev ___ Python tracker

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2b8d9276ad5b by Zachary Ware in branch '2.7': Issue #21303, #20565: Updated the version of Tcl/Tk used on Windows http://hg.python.org/cpython/rev/2b8d9276ad5b -- nosy: +python-dev ___ Python tracker

[issue21327] socket.type value changes after using settimeout()

2014-04-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think distinguishing between the two situations would make the code yet more complicated (and fragile). It's a bit unfortunate that the `type` attribute has become a kitchen sink for disparate pieces of configuration. The fact that you are the first to

[issue21331] Reversing an encoding with unicode-escape returns a different result

2014-04-22 Thread Sworddragon
New submission from Sworddragon: I have made some tests with encoding/decoding in conjunction with unicode-escape and got some strange results: print('ä') ä print('ä'.encode('utf-8')) b'\xc3\xa4' print('ä'.encode('utf-8').decode('unicode-escape')) ä

[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-22 Thread Zachary Ware
Zachary Ware added the comment: Done. Michael, thanks for the report! -- assignee: - zach.ware resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21303

[issue20565] Update Tcl/Tk version for buildbots

2014-04-22 Thread Zachary Ware
Zachary Ware added the comment: 2.7 is now updated to 8.5.15, 3.3 is in security mode, and 3.4+ are on 8.6.1. -- nosy: +zach.ware resolution: - fixed stage: - resolved status: open - closed versions: +Python 3.5 -Python 3.3 ___ Python tracker

[issue21331] Reversing an encoding with unicode-escape returns a different result

2014-04-22 Thread R. David Murray
R. David Murray added the comment: No. x.encode('unicode-escape').decode('unicode-escape') should return the same result, and it does. The bug, I think, is that bytes.decode('unicode-escape') is not objecting to the non-ascii characters. It appears to be treating them as latin1, and that

[issue20560] tkFileFilter.c: ostypeCount not initialized?

2014-04-22 Thread Zachary Ware
Zachary Ware added the comment: Terry, could you try this again with a fresh build of Tcl/Tk 8.5.15? Update your 2.7 to 2b8d9276ad5b or beyond and run Tools/buildbot/external.bat again, it should take care of it. -- nosy: +zach.ware ___ Python

[issue21306] PEP 466: backport hmac.compare_digest

2014-04-22 Thread Alex Gaynor
Alex Gaynor added the comment: Design question here: compare_digest on Python 3 supports comparing str (text) objects, if they're both ascii-only. This feature is provided, primarily, so you can compare hexdigests or similar. Should the Python 2 version support comparing unicodes? Arguments

[issue21306] PEP 466: backport hmac.compare_digest

2014-04-22 Thread Donald Stufft
Donald Stufft added the comment: try: data = data.encode(ascii) except UnicodeEncodeError: raise TypeError(comparing unicode with non-ASCII characters is not supported) ? -- ___ Python tracker rep...@bugs.python.org

[issue21306] PEP 466: backport hmac.compare_digest

2014-04-22 Thread Nick Coghlan
Nick Coghlan added the comment: 8-bit str only makes more sense to me. The wishy-washiness of some APIs in Py3 is mostly to work around porting issues where stuff that should have become bytes was left as str. -- ___ Python tracker

[issue21306] PEP 466: backport hmac.compare_digest

2014-04-22 Thread Alex Gaynor
Alex Gaynor added the comment: encode(ascii) has data dependent branches, so it's to be avoided. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21306 ___

[issue21306] PEP 466: backport hmac.compare_digest

2014-04-22 Thread Alex Gaynor
Alex Gaynor added the comment: Thanks Nick. I'll get a patch up for str (bytes) only this afternoon. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21306 ___

[issue21306] PEP 466: backport hmac.compare_digest

2014-04-22 Thread Donald Stufft
Donald Stufft added the comment: I'm not sure that the timing leakage in an encode is actually something to be worried about. I'm not sure what secret information would be getting leaked in a way that you could determine it by examining the timing. However I think the bigger thing is if I'm

[issue21327] socket.type value changes after using settimeout()

2014-04-22 Thread STINNER Victor
STINNER Victor added the comment: I would prefer to add something to get the type without SOCK_NONBLOCK nor SOCK_CLOEXEC. So new feature can only be added to Python 3.5. For older Python versions, you can to filter manually, which is difficult because you have yo check if SOCK_NONBLOCK and/or

[issue21331] Reversing an encoding with unicode-escape returns a different result

2014-04-22 Thread STINNER Victor
STINNER Victor added the comment: unicode_escape codec is deprecated since Python 3.3. Please use UTF-8 or something else. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21331 ___

[issue4913] wave.py: add writesamples() and readsamples()

2014-04-22 Thread Joe Button
Joe Button added the comment: Forgive my unfamiliarity with python's development process, but, what is happening with this? Is there any chance of this enhancement making it into the python libs? What would need to happen? Thanks. -- nosy: +Joeboy

[issue21306] PEP 466: backport hmac.compare_digest

2014-04-22 Thread Alex Gaynor
Alex Gaynor added the comment: Attached patch implements compare_digest. Code is mostly a 1-1 from 3.x, except the Unicode paths are changed, and the tests are a tiny bit different. * Still needs to backport the docs. * Compares all unicode objects, not just ascii ones. If the patch looks

[issue4913] wave.py: add writesamples() and readsamples()

2014-04-22 Thread R. David Murray
R. David Murray added the comment: Someone has to find the time to do a commit review on the patch. As Guilherme said, there's no specific maintainer for wave, so I'm afraid it just got forgotten about. On the other hand, as a new feature it would now go in 3.5, and we're at the start of

[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch using an anonymous struct. -- Added file: http://bugs.python.org/file35006/urandom_fd_reopen2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21207

[issue21127] Path objects cannot be constructed from str subclasses

2014-04-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset c24cbd9bd63b by Antoine Pitrou in branch '3.4': Issue #21127: Path objects can now be instantiated from str subclass instances (such as numpy.str_). http://hg.python.org/cpython/rev/c24cbd9bd63b New changeset aad6d6b819ed by Antoine Pitrou in

[issue21127] Path objects cannot be constructed from str subclasses

2014-04-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I've committed a patch (to 3.4 and 3.5) that force-casts to str. Thank you for reporting this bug! -- resolution: - fixed stage: - resolved status: open - closed type: - behavior versions: +Python 3.4 ___

[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-22 Thread Daniel Black
Daniel Black added the comment: maybe you've thought and dismissed this already but os.close could call dev_urandom_close for the urandom_fd. Then there's no fstat calls in every random access. As a sweeping close all isn't going to occur that often and extra open probably isn't that much

[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: maybe you've thought and dismissed this already but os.close could call dev_urandom_close for the urandom_fd. Then there's no fstat calls in every random access. That's fine if os.close() is indeed used to close fd, but not if some third-party library uses

[issue4913] wave.py: add writesamples() and readsamples()

2014-04-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: Serhiy, is this something you can review? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4913 ___

[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-22 Thread Daniel Black
Daniel Black added the comment: fine by me. was just a thought -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21207 ___ ___ Python-bugs-list

[issue21332] subprocess bufsize=1 docs are misleading

2014-04-22 Thread raylu
New submission from raylu: https://docs.python.org/3.3/library/subprocess.html says bufsize will be supplied as the corresponding argument to the open() function when creating the stdin/stdout/stderr pipe file objects: ... 1 means line buffered but it calls io.open with 'wb' and 'rb':

[issue4913] wave.py: add writesamples() and readsamples()

2014-04-22 Thread Joe Button
Joe Button added the comment: On quickly looking at this, the immediate issue seems to me to be that there is no patch, as I understand the term. If it would be helpful I can look at turning the code in the attached files into a patch against default and ensure the tests pass (but not right

[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-22 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21321 ___ ___ Python-bugs-list mailing

[issue10510] distutils upload/register should use CRLF in HTTP requests

2014-04-22 Thread Ian Cordasco
Changes by Ian Cordasco graffatcolmin...@gmail.com: -- nosy: +icordasc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10510 ___ ___

[issue21324] dbhash leaks random memory fragments to a database

2014-04-22 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21324 ___ ___ Python-bugs-list mailing list

[issue21324] dbhash leaks random memory fragments to a database

2014-04-22 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Marcin, what Berkeley DB version are you using?. Platform?. 32 or 64 bits? Could you be able to compile test a custom python patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21324

[issue21324] dbhash leaks random memory fragments to a database

2014-04-22 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: dbhash uses bsddb behind the curtain. Could you possibly try current bsddb external module at http://www.jcea.es/programacion/pybsddb.htm ?? Thanks. -- ___ Python tracker rep...@bugs.python.org

[issue21330] Typo in Unicode HOWTO documentation

2014-04-22 Thread Benjamin Peterson
Benjamin Peterson added the comment: http://hg.python.org/cpython/rev/b428b803f71f http://hg.python.org/cpython/rev/660d53bfb332 http://hg.python.org/cpython/rev/ae4a9000e925 -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___

[issue21324] dbhash leaks random memory fragments to a database

2014-04-22 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Experimenting with this, looks like the content leak is inside Berkeley DB code. The leak is always on offset X*4096 bytes away when the database pagesize is 4096 bytes. Looks like this is an important hint, since Python itself knows nothing about database

[issue21324] dbhash leaks random memory fragments to a database

2014-04-22 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: The C version reuses buffers, so the content leak is less probable. Could you possibly change the buffer for a malloc/free pair and try again?. -- ___ Python tracker rep...@bugs.python.org

[issue17160] test_urllib2net fails

2014-04-22 Thread Zachary Ware
Zachary Ware added the comment: This was already fixed, just not before 2.7.6 was released. -- nosy: +zach.ware status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17160 ___

[issue17160] test_urllib2net fails

2014-04-22 Thread Zachary Ware
Zachary Ware added the comment: Actually, that's not quite right. It was fixed in 2.7.6, then changes to the website broke it again and it has been fixed again since then. Either way, it ain't broke right now ;) -- ___ Python tracker

[issue4913] wave.py: add writesamples() and readsamples()

2014-04-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: A patch against default, including a test, would be helpful. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4913 ___

[issue21333] Document recommended exception for objects that shouldn't be pickled

2014-04-22 Thread Stefan Schwarzer
New submission from Stefan Schwarzer: I recently was confused whether to raise a `PicklingError` or `TypeError` in `__getstate__` if objects of my class can't and shouldn't be pickled. [1] Terry Reedy advised I should use `TypeError`. [2] I wonder if the `pickle` module documention should