[issue24623] Parser: broken line numbers for triple-quoted strings

2015-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue16806 -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> col_offset is -1 and lineno is wrong for multiline string expressions

[issue25631] Segmentation fault with invalid Unicode command-line arguments in embedded Python

2015-11-16 Thread Eryk Sun
Eryk Sun added the comment: The interpreter isn't initialized, so calling PyErr_Format in a release build segfaults when it tries to dereference a NULL PyThreadState. OTOH, a debug build should call PyThreadState_Get, which in this case calls Py_FatalError and aborts the process.

[issue25498] Python 3.4.3 regression in ctypes.frombuffer()

2015-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset b04ae5392cf2 by Serhiy Storchaka in branch '3.4': Issue #25498: Fixed contributors name. https://hg.python.org/cpython/rev/b04ae5392cf2 New changeset 3738b0ca1356 by Serhiy Storchaka in branch '3.5': Issue #25498: Fixed contributors name.

[issue13821] misleading return from isidentifier

2015-11-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +pitrou ___ Python tracker ___ ___

[issue21579] Python 3.4: tempfile.close attribute does not work

2015-11-16 Thread Марк Коренберг
Марк Коренберг added the comment: Please merge patch, proposed by Eduardo Seabra (Eduardo.Seabra). And document that this is UNIX-only solution. -- versions: +Python 3.5, Python 3.6 Added file: http://bugs.python.org/file41055/test_tempfile.py ___

[issue25635] urllib2 cannot fully read FTP file

2015-11-16 Thread keakon
New submission from keakon: I found the bug from this slide: http://sector.ca/Portals/17/Presentations15/SecTor_Branca.pdf The second way cannot fully read the file. import urllib2 url = 'ftp://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest' response = urllib2.urlopen(url)

[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-16 Thread R. David Murray
R. David Murray added the comment: I understand what you are concerned about, but unfortunately that would be a significant backward compatibility break. This would need discussion on python-ideas, I think. Even aside from the backward compatibility issue I have a feeling the additional

[issue22555] Tracking issue for adjustments to binary/text boundary handling

2015-11-16 Thread Nick Coghlan
Nick Coghlan added the comment: In discussing the Windows aspects of the bytes/text boundary handling issues with Brett & Steve recently, I realised I hadn't clearly defined what "fixed" looked like from my perspective. The attached test case is an initial attempt at that. It currently fails

[issue25635] urllib2 cannot fully read FTP file

2015-11-16 Thread R. David Murray
R. David Murray added the comment: Most likely it is a timing issue, with the response object sometimes getting GCed before the read is complete (your local server would make this less likely since the read would complete sooner). I think this has been fixed in python3. Can you check? Note,

[issue557704] netrc module can't handle all passwords

2015-11-16 Thread Cristian Măgherușan-Stanciu
Cristian Măgherușan-Stanciu added the comment: Why is this issue fixed? I still see this problem on 2.7 and 3.4.3. Can someone please reopen it? mdengler's patch seems to work fine on my machine on both 2.7 and 3.4.3. -- nosy: +Cristian Măgherușan-Stanciu

[issue25626] Gzip fails for file over 2**32 bytes

2015-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is 3.4 affected? A uint_converter was added in issue18294. -- ___ Python tracker ___

[issue24750] IDLE: Cosmetic improvements for main window

2015-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset ff31af003c35 by Terry Jan Reedy in branch '2.7': Issue #24750: Improve appearance of IDLE editor window status bar. https://hg.python.org/cpython/rev/ff31af003c35 New changeset ecb74f61a5d4 by Terry Jan Reedy in branch '3.4': Issue #24750: Improve

[issue24750] IDLE: Cosmetic improvements for main window

2015-11-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Leaving open for now for scrollbar upgrade. -- ___ Python tracker ___ ___

[issue24313] json fails to serialise numpy.int64

2015-11-16 Thread Eli_B
Changes by Eli_B : -- nosy: +Eli_B ___ Python tracker ___ ___ Python-bugs-list

[issue25616] Extract OrderedDict tests into separate file

2015-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Raymond. Here is a patch. It is in Git format, hence Rietveld will not work with it. During creating a patch I found a bug in test_dict_update, it tested only default implementation and didn't test subclasses. -- keywords: +patch stage:

[issue13821] misleading return from isidentifier

2015-11-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> docs@python components: +Documentation nosy: +docs@python, haypo, serhiy.storchaka stage: -> needs patch type: -> behavior versions: +Python 3.4, Python 3.5, Python 3.6 ___ Python

[issue24313] json fails to serialise numpy.int64

2015-11-16 Thread Eli_B
Eli_B added the comment: On 64-bit Windows, my 64-bit Python 2.7.9 and my 32-bit 2.7.10 Python both reproduce the failure with a similar traceback. -- ___ Python tracker

[issue25636] Let launcher autoselect best 32-bit Python on 64-bit system

2015-11-16 Thread Christian Ullrich
New submission from Christian Ullrich: As described in PEP 397, the launcher can autoselect the "best" Python version available on a system, or a full version number (major.minor) can be specified. In the latter case, optionally a "-32" suffix can be given to select a 32-bit version, which is

[issue25609] Add a ContextManager ABC and type

2015-11-16 Thread Brett Cannon
Brett Cannon added the comment: The reason I suggested the ABC for context managers is mostly to provide a way to help people make sure to implement __enter__() and to provide a default __exit__() which has the proper signature (I personally always forget how many arguments __exit__() takes

[issue22555] Tracking issue for adjustments to binary/text boundary handling

2015-11-16 Thread Steve Dower
Steve Dower added the comment: Right now all of the tests fail on Windows by default (cp437 for me). If I change the default IO encoding to utf-8 (hacked into pylifecycle.c, since PYTHONIOENCODING is ignored by subprocesses using -E), the four "Misconfigured" tests crash at the os.fsencode()

[issue25637] Move non-collections-related ABCs out of collections.abc

2015-11-16 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___

[issue25637] Move non-collections-related ABCs out of collections.abc

2015-11-16 Thread Yury Selivanov
Yury Selivanov added the comment: We had this discussion when we were adding Awaitable, AsyncIterable etc. I suggested to simply put them in the top-level 'abc' module (where ABCMeta is defined). -- nosy: +yselivanov ___ Python tracker

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread R. David Murray
R. David Murray added the comment: Can you provide a minimum reproducer? It looks like you are somehow managing to use EmailMessage with the compat34 policy, which shouldn't happen unless you work at it, or I overlooked something. Perhaps EmailMessage should disallow setting policy to

[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-16 Thread Brett Cannon
Brett Cannon added the comment: Let's not pollute the issue with a critique of my notebook. You can feel free to email me personally to discuss it if you want, including why I purposefully didn't use a logarithmic scale. -- ___ Python tracker

[issue25639] open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: [WinError 1] Incorrect function

2015-11-16 Thread Roman Kozhemiakin
New submission from Roman Kozhemiakin: open('.\\PHYSICALDRIVE1','rb',0) fails since python 3.5 At the end of _io_FileIO___init___impl function _Py_fstat call raise OSError: [WinError 1] Incorrect function _Py_fstat result not used on windows in this place. 440 self->blksize =

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2015-11-16 Thread Martin Panter
Martin Panter added the comment: There is another patch in duplicate Issue 8823, which has simpler exception wrapping code, but does not add wrapping of reply exceptions. Personally, I wouldn’t endorse any new wrapping HTTP client exceptions, and even if wrapping more socket OS errors would

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread Matthieu Pepin
Matthieu Pepin added the comment: Yes, I will make a small reproducer. -- ___ Python tracker ___ ___

[issue25641] urllib/request.py/getproxies_environment() throws "dictionary changed size during iteration" error occasionally

2015-11-16 Thread Martin Panter
Martin Panter added the comment: How are you managing to get os.environ to change inside that function? Another thread or garbage collector callback perhaps? My understanding is that os.environ is coupled to the C library’s environment, and that is not thread-safe. -- nosy:

[issue25639] open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: [WinError 1] Incorrect function

2015-11-16 Thread SilentGhost
Changes by SilentGhost : -- components: +IO, Windows keywords: +3.5regression nosy: +benjamin.peterson, paul.moore, pitrou, steve.dower, stutzbach, tim.golden, zach.ware stage: -> test needed ___ Python tracker

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread Matthieu Pepin
New submission from Matthieu Pepin: Message.is_attachment() throws the exception below: File "/usr/lib/python3.5/email/message.py", line 956, in is_attachment return False if c_d is None else c_d.content_disposition == 'attachment' AttributeError: 'str' object has no attribute

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread R. David Murray
R. David Murray added the comment: I mean compat32. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think these histograms would look better with logarithmic scale. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread Matthieu Pepin
Matthieu Pepin added the comment: Ok I think the bug is not where I thought. First, my workaround does not work. Second, I use the following to generate my Message: message_from_string(s, _class=EmailMessage) Maybe the bug is in the parser? -- ___

[issue25641] urllib/request.py/getproxies_environment() throws "dictionary changed size during iteration" error occasionally

2015-11-16 Thread alphalfalfa
New submission from alphalfalfa: For the following lines of code, "dictionary changed size during iteration" would be thrown when the environment variables change while in iteration. Python-3.5.0/Lib/urllib/request.py 2393 for name, value in os.environ.items(): 2394 name =

[issue25639] open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: [WinError 1] Incorrect function

2015-11-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +haypo ___ Python tracker ___ ___

[issue8823] urllib2 does not catch httplib.BadStatusLine

2015-11-16 Thread Martin Panter
Martin Panter added the comment: Issue 13736 also proposes to wrap HTTP client exceptions, although I personally don’t really endorse this. The other option is to fix the documentation: Issue 25633, Issue 22797. -- resolution: accepted -> duplicate status: open -> closed superseder:

[issue25633] The documentation for urllib.request should mention http.client.HTTPException

2015-11-16 Thread Martin Panter
Martin Panter added the comment: Closely related: Issue 22797 proposes documenting some circumstances where ValueError is raised directly. Perhaps you can review and enhance the patch already there. Also related: Issue 13736 proposes to wrap http.client exceptions (which I disagree with),

[issue7759] mhlib fails on Btrfs filesystem (test_mhlib failure)

2015-11-16 Thread Neil Schemenauer
Neil Schemenauer added the comment: Okay, feel free to close this bug. I had heard that HFS+ counts files but I don't have a way to verify that. -- ___ Python tracker

[issue25637] Move non-collections-related ABCs out of collections.abc

2015-11-16 Thread Brett Cannon
Brett Cannon added the comment: I guess is the objection of putting concrete ABCs in the abc module is that the abc module contains the actual code to implement ABCs and not ABCs themselves. Personally I would be fine with a submodule within abc like abc.interfaces. Personally I'm starting to

[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, so when you say "horrible for everyone", this is really IronPython and Jython, right? :-) Other runtimes seem to do ok (perhaps not stellar, but ok). -- ___ Python tracker

[issue25626] Gzip fails for file over 2**32 bytes

2015-11-16 Thread Martin Panter
Martin Panter added the comment: 3.4 shouldn’t be affected by the gzip regression. In 3.4 the gzip module does not set max_length to limit the decompression size. In 3.4 the underlying zlib module will also raise OverflowError if max_lenth=2**32, and my patch could be applied, but I don’t

[issue25637] Move non-collections-related ABCs out of collections.abc

2015-11-16 Thread Brett Cannon
New submission from Brett Cannon: In discussing adding a context manager ABC in issue #25609, the idea of creating a new module for ABCs that is more analogous to the types modules came up. Currently all ABCs that are generic in the stdlib and don't belong to a specific module end up in

[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-16 Thread Brett Cannon
Brett Cannon added the comment: That link is to a Jupyter notebook so you don't have to watch anything. Plus the video is not even up yet so you can't skip the keynote even if you wanted to since you can't watch it yet. :) -- ___ Python tracker

[issue7759] mhlib fails on Btrfs filesystem (test_mhlib failure)

2015-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, what I read, HFS+ counts files. st_ntlink is a number of files and directories + 2 (perhaps for fake "." and ".."). This value never less than 2 + number_of_subdirectories, hence the code should work. Just an optimization has no any effect (as well as

[issue25609] Add a ContextManager ABC and type

2015-11-16 Thread Brett Cannon
Brett Cannon added the comment: Depending on how issue #25637 turns out, the ABC could go into contextlib or a new interfaces modules. -- ___ Python tracker

[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-16 Thread Brett Cannon
New submission from Brett Cannon: If you look at bit.ly/pycon-ca-keynote you will notice that the etree_parse and etree_iterparse benchmarks were horrible for everyone. Because of how badly everyone seemed to do, I think the benchmarks should be verified to be doing reasonable things on

[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-16 Thread Brett Cannon
Brett Cannon added the comment: Well, Jython and IronPython obviously did the worst, but even Python 3 didn't do as well as I would have expected, so I still want to double-check the benchmarks to see if it's obvious why CPython 2.7 beats out everyone. --

[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-16 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: -> brett.cannon ___ Python tracker ___ ___

[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Would you have a quick summary for those not willing to watch a whole keynote? -- ___ Python tracker ___

[issue20220] test_datetime, test_tarfile, test_strptime time zone failures

2015-11-16 Thread Martin Panter
Martin Panter added the comment: The RHEL and SLES buildbots seem to be much happier. (Apart from timeouts in 2.7, which is probably a separate issue.) I also opened a glibc bug: . -- resolution: -> fixed stage: commit review ->

[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-16 Thread Guido van Rossum
Guido van Rossum added the comment: Thinking about this more I believe it's possible for any of the FD callbacks in selector_events.py to be placed into loop._ready multiple times if the loop is stopped after the FD is ready (and the callback is scheduled) but before the callback is called.

[issue25615] Document unsorted behaviour of glob.glob

2015-11-16 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue25615] Document unsorted behaviour of glob.glob

2015-11-16 Thread Martin Panter
Martin Panter added the comment: I committed the patch as it was. But normally I do try to keep the number of lines in the diff close to the minimum, even when committing. RST files are like source code and it doesn’t matter if the wrapping is not 100% perfect, because they get turned into

[issue25615] Document unsorted behaviour of glob.glob

2015-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset fa4f0096b719 by Martin Panter in branch '2.7': Issue #25615: Document unsorted behaviour of glob; patch by Dave Jones https://hg.python.org/cpython/rev/fa4f0096b719 New changeset 7ca6a13db0e5 by Martin Panter in branch '3.4': Issue #25615: Document

[issue25642] Setting maxsize breaks asyncio.JoinableQueue/Queue

2015-11-16 Thread Guido van Rossum
Guido van Rossum added the comment: Should also be fixed in the next 3.4/3.5 releases. We rewrote the guts of the Queue class to be much simpler. See https://github.com/python/asyncio (specifically, https://github.com/python/asyncio/commit/872597ba12953849cc6893042fd044073b87f870).

[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2015-11-16 Thread Michael Foord
Michael Foord added the comment: I'm happy to blacklist __wrapped__ in call. I don't see how call can detect that kind of introspection in the general case though. Limiting call depth would be one option, but any limit is going to be arbitrary and I don't "like" that as a solution.

[issue24313] json fails to serialise numpy.int64

2015-11-16 Thread Amit Feller
Changes by Amit Feller : -- nosy: +Amit Feller ___ Python tracker ___ ___

[issue25644] Unable to open IDLE on Windows 10 with Python 2.7.10

2015-11-16 Thread Jatin Miglani
New submission from Jatin Miglani: Hi, Seems like an issue with IDLE on Windows 10 with Python 2.7.10 active Python distribution. I'm able to open IDLE but it crash immediately. Try with deleting .idle folder but it couldn't help. Then I moved backed to 2.7.9 version which ultimately

[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-16 Thread Justin Mayfield
Justin Mayfield added the comment: You bet. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue25640] Message.is_attachment() throws exception

2015-11-16 Thread R. David Murray
R. David Murray added the comment: Ah, yes, that would do it. EmailMessage should definitely throw an error if it gets compat32 as a policy, that would have told you what you were doing "wrong". What you want to be doing is: msg = message_from_string(mystring, policy=default) That will

[issue25640] EmailMessage should throw an error if policy is set to compat32

2015-11-16 Thread R. David Murray
Changes by R. David Murray : -- title: Message.is_attachment() throws exception -> EmailMessage should throw an error if policy is set to compat32 ___ Python tracker

[issue25642] Setting maxsize breaks asyncio.JoinableQueue/Queue

2015-11-16 Thread Chris Seto
New submission from Chris Seto: When maxsize is set on a JoinableQueue/Queue and the queue is full (maxsize <= len(queue)) _put is called rather than __put_internal. __put_internal increments _unfinished_tasks but _put does not. Whenever using maxsize in a Queue calling task_done will almost

[issue22555] Tracking issue for adjustments to binary/text boundary handling

2015-11-16 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks. I suspect some of the Windows problems are indeed due to bogus assumptions in my draft tests, but at the same time, folks should be able to invoke subprocesses with Unicode values without needing extensive knowledge of platform specific Unicode handling

[issue25642] Setting maxsize breaks asyncio.JoinableQueue/Queue

2015-11-16 Thread Chris Seto
Chris Seto added the comment: Looks to be fixed in python 3.6 -- resolution: -> fixed ___ Python tracker ___

[issue23883] __all__ lists are incomplete

2015-11-16 Thread Martin Panter
Martin Panter added the comment: issue23883_fileinput.v2.patch looks good to me. -- ___ Python tracker ___

[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-16 Thread Guido van Rossum
Guido van Rossum added the comment: @Justin: Do you want to come up with a PR for the stop() changes? Hopefully including tests (I bet at least one test will fail -- our tests in generally are pretty constraining). On Mon, Nov 16, 2015 at 6:32 PM, Justin Mayfield wrote:

[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-16 Thread Justin Mayfield
Justin Mayfield added the comment: +1 Let me know what I can do to help. -- ___ Python tracker ___ ___

[issue25643] Python tokenizer rewriting

2015-11-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Here is preliminary patch that refactors the lowest level of Python tokenizer, reading and decoding. It splits the code on smaller simpler functions, decreases the source size by 37 lines, and fixes bugs: issue14811, issue18961, and a number of others.

[issue25633] The documentation for urllib.request should mention http.client.HTTPException

2015-11-16 Thread jon orebro
New submission from jon orebro: The documentation for urllib.request should mention that a robust client using urllib.request must be prepared for exceptions of type http.client.HTTPException in addition to urllib.error.URLError. Example: the server breaks HTTP and returns an empty status

[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-16 Thread Jun Wang
New submission from Jun Wang: See this simple example: class A(): def __init__(self, x=None): self.x = x @property def t(self): return self.x.t def __getattr__(self, name): return 'default' print(A().t)

[issue9051] Improve pickle format for timezone aware datetime instances

2015-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset e48da8f01316 by Serhiy Storchaka in branch '3.4': Issue #9051: Added tests for pickling and copying the timezone objects. https://hg.python.org/cpython/rev/e48da8f01316 New changeset 634905e9628d by Serhiy Storchaka in branch '3.5': Issue #9051:

[issue20220] test_datetime, test_tarfile, test_strptime time zone failures

2015-11-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 673b4b093796 by Martin Panter in branch '3.4': Issue #20220: Add DST rules to work around glibc quirk https://hg.python.org/cpython/rev/673b4b093796 New changeset 364bd520d9f1 by Martin Panter in branch '3.5': Issue #20220: Merge time zone

[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict

2015-11-16 Thread Michael Foord
Michael Foord added the comment: Patch looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list

[issue9051] Improve pickle format for timezone aware datetime instances

2015-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> import pickle, pickletools, datetime >>> len(pickle.dumps([datetime.datetime.utcfromtimestamp(i) for i in >>> range(1)], 3)) / 1 30.9283 >>> len(pickle.dumps([datetime.datetime.fromtimestamp(i, datetime.timezone.utc) >>> for i in range(1)],

[issue25641] urllib/request.py/getproxies_environment() throws "dictionary changed size during iteration" error occasionally

2015-11-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: For a simple fix, 2393 should probably read: for name, value in list(os.environ.items()): -- nosy: +rhettinger ___ Python tracker

[issue25639] open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: [WinError 1] Incorrect function

2015-11-16 Thread Eryk Sun
Eryk Sun added the comment: As a workaround you can open a file descriptor via os.open: >>> import os >>> fd = os.open(r'\\.\PhysicalDrive0', os.O_RDONLY | os.O_BINARY) >>> os.read(fd, 512)[:8] b'3\xc0\x8e\xd0\xbc\x00|\x8e' > _Py_fstat result not used on windows in this place.