[issue1738] Add match parameter to filecmp.dircmp to ignore using patterns

2014-03-17 Thread Nikolaus Rath
Nikolaus Rath added the comment: Attached is an updated patch that addresses the comments from Rietveld. Thanks for the feedback! -- Added file: http://bugs.python.org/file34478/issue1738_r2.diff ___ Python tracker <http://bugs.python.org/issue1

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-18 Thread Nikolaus Rath
Nikolaus Rath added the comment: Since this behavior cannot be changed without breaking third-party libraries (why did they work around this rather than reporting a bug?), I'd suggest to document the current behavior and allow programs to opt-in to getting exceptions. I've attach

[issue20375] ElementTree: Document handling processing instructions

2014-03-19 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file34528/issue20951.diff ___ Python tracker <http://bugs.python.org/issue20375> ___ ___ Python-bugs-list m

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-20 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file34540/issue20951.diff ___ Python tracker <http://bugs.python.org/issue20951> ___ ___ Python-bugs-list m

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-20 Thread Nikolaus Rath
Nikolaus Rath added the comment: I'd like to argue with the wise words of Nick Coghlan here: --snip-- There's a great saying in the usability world: "You can't document your way out of a usability problem". What it means is that if all the affordances of your ap

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-20 Thread Nikolaus Rath
Changes by Nikolaus Rath : Removed file: http://bugs.python.org/file34540/issue20951.diff ___ Python tracker <http://bugs.python.org/issue20951> ___ ___ Python-bugs-list m

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-20 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file34541/issue20951.diff ___ Python tracker <http://bugs.python.org/issue20951> ___ ___ Python-bugs-list m

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-24 Thread Nikolaus Rath
Nikolaus Rath added the comment: (refreshed patch) -- Added file: http://bugs.python.org/file34608/issue20951.diff ___ Python tracker <http://bugs.python.org/issue20

[issue15955] gzip, bz2, lzma: add option to limit output size

2014-03-24 Thread Nikolaus Rath
Nikolaus Rath added the comment: Thanks Nadeem. I'll get going. -- ___ Python tracker <http://bugs.python.org/issue15955> ___ ___ Python-bugs-list m

[issue15955] gzip, bz2, lzma: add option to limit output size

2014-03-24 Thread Nikolaus Rath
Nikolaus Rath added the comment: I have attached a patch adding the max_length parameter to LZMADecompressor.decompress(). I have chosen to store the pointer to any unconsumed input in the lzma stream object itself. The new convention is: if lzs.next_in != NULL, then there is valid data

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-24 Thread Nikolaus Rath
New submission from Nikolaus Rath: In Python 3.4, TextIOWrapper can not read from streams that return bytearrays or memoryviews: from io import TextIOWrapper, BytesIO class MyByteStream(BytesIO): def read1(self, len_): return memoryview(super().read(len_)) bs = MyByteStream(b'

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-24 Thread Nikolaus Rath
Nikolaus Rath added the comment: If someone is willing to review, I'd be happy to write a patch for this. -- ___ Python tracker <http://bugs.python.org/is

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-25 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 03/25/2014 01:39 PM, Serhiy Storchaka wrote: > read1() should return bytes. MyByteStream doesn't implement the > io.BufferedIOBase interface. Indeed, this is what this issue is about :-). The question is: is there a good reason to require io.Buf

[issue20375] ElementTree: Document handling processing instructions

2014-03-25 Thread Nikolaus Rath
Changes by Nikolaus Rath : Removed file: http://bugs.python.org/file34528/issue20951.diff ___ Python tracker <http://bugs.python.org/issue20375> ___ ___ Python-bugs-list m

[issue20375] ElementTree: Document handling processing instructions

2014-03-25 Thread Nikolaus Rath
Nikolaus Rath added the comment: Indeed I did, here's the correct patch. Thanks! -- Added file: http://bugs.python.org/file34622/issue20375.diff ___ Python tracker <http://bugs.python.org/is

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-25 Thread Nikolaus Rath
Nikolaus Rath added the comment: Yes, bytes objects have some advantages. But if a bytes object is desired, it can always be created from bytes-like object. If a BufferedIOBase instance is required to only provide bytes objects, this conversion is forced even when it may not be necessary. If

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-25 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 03/25/2014 06:53 PM, Ben Darnell wrote: > Another option may be to have SSLSocket.send() convert the WANT_WRITE > exception into a socket.error with errno EAGAIN. This wouldn't break Tornado > and would make socket.send and SSLSocket.send m

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-26 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 03/26/2014 03:43 AM, STINNER Victor wrote: >> class MyByteStream(BytesIO): >>def read1(self, len_): >>return memoryview(super().read(len_)) >> bs = MyByteStream(b'some data in ascii\n') > > I guess that you

[issue20578] BufferedIOBase.readinto1 is missing

2014-03-26 Thread Nikolaus Rath
Nikolaus Rath added the comment: I have attached a patch that adds readinto1() to BufferedReader and BufferedRWPair. An example use case for this method is receiving a large stream over a protocol like HTTP. You want to use a buffered reader so you can efficiently parse the header, but after

[issue20578] BufferedIOBase.readinto1 is missing

2014-03-26 Thread Nikolaus Rath
Changes by Nikolaus Rath : -- nosy: +benjamin.peterson, hynek, stutzbach ___ Python tracker <http://bugs.python.org/issue20578> ___ ___ Python-bugs-list mailin

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-26 Thread Nikolaus Rath
Nikolaus Rath added the comment: As an alternative, I have attached a pure docpatch that just documents the future behavior. Someone with commit privileges: please take your pick :-). -- Added file: http://bugs.python.org/file34633/docpatch.diff

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-27 Thread Nikolaus Rath
Nikolaus Rath added the comment: I'm attaching a patch that enables TextIOWrapper to work with bytes-like objects from the underlying file descriptor. The code changes are pretty small, without introducing any significant additional complexity. For streams providing bytes objects, this

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-27 Thread Nikolaus Rath
Changes by Nikolaus Rath : Removed file: http://bugs.python.org/file34645/issue21057.diff ___ Python tracker <http://bugs.python.org/issue21057> ___ ___ Python-bugs-list m

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-27 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file34646/issue21057.diff ___ Python tracker <http://bugs.python.org/issue21057> ___ ___ Python-bugs-list m

[issue20375] ElementTree: Document handling processing instructions

2014-03-31 Thread Nikolaus Rath
Nikolaus Rath added the comment: Yes, the new testcases were deliberately included. I submitted the patch prior to the 3.4 release, am I right that at that point this wouldn't have been a problem? I have attached a new patch containing just the doc changes. I hope that's still acce

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-31 Thread Nikolaus Rath
Nikolaus Rath added the comment: Thanks for the feedback! I have attached an updated patch. I did not include any testcase because the patch did not create any new code paths, so I was assuming it'd be covered by the existing test case. But of course I was wrong. In the revised patch, I

[issue20375] ElementTree: Document handling processing instructions

2014-04-02 Thread Nikolaus Rath
Nikolaus Rath added the comment: Thanks for your feedback! I've attached an updated patch. -- Added file: http://bugs.python.org/file34708/issue20375.diff ___ Python tracker <http://bugs.python.org/is

[issue20375] ElementTree: Document handling processing instructions

2014-04-02 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file34709/issue20375.diff ___ Python tracker <http://bugs.python.org/issue20375> ___ ___ Python-bugs-list m

[issue20375] ElementTree: Document handling processing instructions

2014-04-03 Thread Nikolaus Rath
Nikolaus Rath added the comment: Thanks for the commit! My intention is to fix the behavior itself for 3.5 (see issue 9521), so I think adding testcases for the old behavior in the meantime isn't necessary. -- ___ Python tracker

[issue20375] ElementTree: Document handling processing instructions

2014-04-03 Thread Nikolaus Rath
Changes by Nikolaus Rath : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue20375> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue15955] gzip, bz2, lzma: add option to limit output size

2014-04-11 Thread Nikolaus Rath
Nikolaus Rath added the comment: I've attached the second iteration of the patch. I've factored out a new function decompress_buf, and added two new (C only) instance variables input_buffer and input_buffer_size. I've tested the patch by enabling Py_USING_MEMORY_DEBUG

[issue15955] gzip, bz2, lzma: add option to limit output size

2014-04-12 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file34792/issue15955_r3.diff ___ Python tracker <http://bugs.python.org/issue15955> ___ ___ Python-bug

[issue20578] BufferedIOBase.readinto1 is missing

2014-04-12 Thread Nikolaus Rath
Nikolaus Rath added the comment: Seems as if no one has an opinion on this at all: https://mail.python.org/pipermail/python-dev/2014-April/133739.html What next? -- ___ Python tracker <http://bugs.python.org/issue20

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-04-12 Thread Nikolaus Rath
Nikolaus Rath added the comment: My usecase is that I have a binary stream class that internally uses memoryviews. I would like to read text data from this stream and thus encapsulate it in a TextIOWrapper. Currently, TextIOWrapper (correctly) expects read() to return bytes and fails if it

[issue20578] BufferedIOBase.readinto1 is missing

2014-04-12 Thread Nikolaus Rath
Nikolaus Rath added the comment: Thanks for the review! Attached is a new patch. I was actually pretty careful to avoid any code duplication.. are you refering to the readinto1() implementations for BytesIO and BufferedReader in Lib/_pyio.py? -- Added file: http://bugs.python.org

[issue1738] Add match parameter to filecmp.dircmp to ignore using patterns

2014-04-13 Thread Nikolaus Rath
Nikolaus Rath added the comment: Updated patch to acknowledge original authors in Misc/ACKS. -- Added file: http://bugs.python.org/file34801/issue1738_r3.diff ___ Python tracker <http://bugs.python.org/issue1

[issue7776] http.client.HTTPConnection tunneling is broken

2014-04-13 Thread Nikolaus Rath
Nikolaus Rath added the comment: Refreshed patch. -- Added file: http://bugs.python.org/file34802/issue7776_r7_Py3.4.diff ___ Python tracker <http://bugs.python.org/issue7

[issue7776] http.client.HTTPConnection tunneling is broken

2014-04-13 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file34803/issue7776_r7_Py3.5.diff ___ Python tracker <http://bugs.python.org/issue7776> ___ ___ Python-bug

[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances

2014-04-13 Thread Nikolaus Rath
Nikolaus Rath added the comment: The patch applies cleanly to 3.4 and 3.5, not sure why the review link does not show up. I'm attaching the file again, maybe that helps. -- Added file: http://bugs.python.org/file34804/issue19414_r2.diff ___ P

[issue20578] BufferedIOBase.readinto1 is missing

2014-04-13 Thread Nikolaus Rath
Nikolaus Rath added the comment: Here's a little script to estimate the performance difference between using read1 and readinto1 to read large amounts of data. On my system, I get: C readinto1: 4.960e-01 seconds C read1: 4.055e-01 seconds Python readinto1: 1.066e+00 seconds Python

[issue20578] BufferedIOBase.readinto1 is missing

2014-04-13 Thread Nikolaus Rath
Nikolaus Rath added the comment: (Rietveld is giving me errors, so I'm replying here) On 2014/04/13 02:22:23, loewis wrote: >>> Again, why a separate implementation here? >> >> For performance reasons. Relying on the default implementation >> would fall back to

[issue20578] BufferedIOBase.readinto1 is missing

2014-04-13 Thread Nikolaus Rath
Nikolaus Rath added the comment: > Can you please extend your benchmark to also measure read and readinto? Yes - but I don't quite understand why it matters (if you need read1/readinto1, you cannot just use read/readinto instead). C readinto1: 4.638e-01 seconds C read1: 4.026e-01

[issue10983] Errors in http.client.HTTPConnection class (python3)

2014-04-14 Thread Nikolaus Rath
Nikolaus Rath added the comment: This issue can be closed. The testcases have been added in 39ee3286d187. -- ___ Python tracker <http://bugs.python.org/issue10

[issue20578] BufferedIOBase.readinto1 is missing

2014-04-14 Thread Nikolaus Rath
Nikolaus Rath added the comment: Attached is an updated patch that - removes the code duplication in _pyio.BufferedIOBase - adds an internal _readinto helper method to _pyio.BufferedReader that makes the implementation similar to io.BufferedReader. - implements _pyio.BuffereadReader

[issue20578] BufferedIOBase.readinto1 is missing

2014-04-14 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file34864/benchmark_r3.py ___ Python tracker <http://bugs.python.org/issue20578> ___ ___ Python-bugs-list m

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-04-27 Thread Nikolaus Rath
Nikolaus Rath added the comment: As discussed on python-dev, here is a patch that changes the behavior of send() and sendall() to raise SSLWant* exceptions instead of returning zero. -- Added file: http://bugs.python.org/file35062/issue20951_r2.diff

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-04-28 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file35082/issue20951_r3.diff ___ Python tracker <http://bugs.python.org/issue20951> ___ ___ Python-bug

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-04-28 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file35083/issue_21057_r3.diff ___ Python tracker <http://bugs.python.org/issue21057> ___ ___ Python-bug

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-28 Thread Nikolaus Rath
Nikolaus Rath added the comment: Tentative patch attached. The test suite still passes, but I'm not sure if it actually exerts the new code path. Is there a standard way to test the C api? -- keywords: +patch Added file: http://bugs.python.org/file35084/issue_21377

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-28 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file35085/issue_21377_r2.diff ___ Python tracker <http://bugs.python.org/issue21377> ___ ___ Python-bug

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-29 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file35100/issue_21377_r3.diff ___ Python tracker <http://bugs.python.org/issue21377> ___ ___ Python-bug

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-04-29 Thread Nikolaus Rath
Nikolaus Rath added the comment: Antoine, are you sure this was a problem related to this patch? The test seems to work just fine for me: $ hg update -C -r b0f6983d63df $ make clean $ ./configure --with-pydebug && make -j1 $ ./python -m test -u network,urlfetch -j 8 test_pop

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-04-30 Thread Nikolaus Rath
Nikolaus Rath added the comment: Maybe. I have 1.0.1g. Could you maybe post the output of the failed test? I'd like to understand how the patch broke the test (looking at your patch alone didn't tell me much). -- ___ Python trac

[issue21377] PyBytes_Concat could try to concat in-place

2014-04-30 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file35123/issue_21377_r4.diff ___ Python tracker <http://bugs.python.org/issue21377> ___ ___ Python-bug

[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances

2014-05-07 Thread Nikolaus Rath
Nikolaus Rath added the comment: Raymond, I think your patch does not really address the issue reported here. The dict documentation still guarantees that mutating a dict during iteration will raise a RuntimeError or may skip elements. The OrderedDict documentation still does not point out

[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-09 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 05/09/2014 02:02 PM, Cybjit wrote: > C:\Python34\Scripts>pip -v install simplejson > Downloading/unpacking simplejson > Could not fetch URL https://pypi.python.org/simple/simplejson/: connection > err > or: hostname 'openwrt.lan&#

[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-11 Thread Nikolaus Rath
Nikolaus Rath added the comment: Cybjit writes: > Cybjit added the comment: > > On 2014-05-10 00:23, nikratio wrote: >> Is pip maybe doing its own certificate check, and relying on >> HTTPSConnection.host to contain the final hostname rather than the proxy? > > I thin

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-05-13 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 05/13/2014 12:41 PM, Serhiy Storchaka wrote: > Note that this is not work with the punycode encoding (and may be some > third-party encodings). I do not understand. Could you elaborate? -- ___ Python t

[issue21555] gcmodule.c could use pytime.h

2014-05-22 Thread Nikolaus Rath
Changes by Nikolaus Rath : -- nosy: +nikratio ___ Python tracker <http://bugs.python.org/issue21555> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-05-24 Thread Nikolaus Rath
Nikolaus Rath added the comment: Tal, I was referring to this mail: https://mail.python.org/pipermail/python-dev/2014-January/132066.html -- ___ Python tracker <http://bugs.python.org/issue20

[issue17277] incorrect line numbers in backtrace after removing a trace function

2014-06-02 Thread Nikolaus Rath
Changes by Nikolaus Rath : -- nosy: +nikratio ___ Python tracker <http://bugs.python.org/issue17277> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20578] BufferedIOBase.readinto1 is missing

2014-06-08 Thread Nikolaus Rath
Nikolaus Rath added the comment: Thanks for taking the time, and apologies about the test failure. I was probably too eager and ran only the test_io suite instead of everything. I looked at the failure, and the problem is that the default Python BufferedIOBase.readinto implementation is semi

[issue20578] BufferedIOBase.readinto1 is missing

2014-06-08 Thread Nikolaus Rath
Nikolaus Rath added the comment: I used the wrong interpreter when cutting and pasting the example above, here's the correct version to avoid confusion with the traceback: >>> import _pyio >>> from array import array >>> buf = array('b', b'x&#x

[issue15955] gzip, bz2, lzma: add option to limit output size

2014-06-14 Thread Nikolaus Rath
Nikolaus Rath added the comment: Nadeem, did you get a chance to look at this? -- ___ Python tracker <http://bugs.python.org/issue15955> ___ ___ Python-bugs-list m

[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances

2014-06-14 Thread Nikolaus Rath
Nikolaus Rath added the comment: Raymond, it would be nice if you could respond to my last comment... -- ___ Python tracker <http://bugs.python.org/issue19

[issue21763] Clarify requirements for file-like objects

2014-06-14 Thread Nikolaus Rath
New submission from Nikolaus Rath: It is currently not perfectly clear what Python (and the standard library) assumes about file-like objects (see e.g. http://article.gmane.org/gmane.comp.python.devel/148199). The attached doc patch tries to improve the current situation by stating

[issue21764] Document that IOBase.__del__ calls self.close

2014-06-14 Thread Nikolaus Rath
New submission from Nikolaus Rath: CPython's io.IOBase.__del__ calls self.close(), but this isn't documented anywhere (and may be surprised for derived classes). The attached patch extends the documentation. -- assignee: docs@python components: Documentation files: io

[issue21764] Document that IOBase.__del__ calls self.close

2014-06-14 Thread Nikolaus Rath
Changes by Nikolaus Rath : Removed file: http://bugs.python.org/file35637/iobase2.diff ___ Python tracker <http://bugs.python.org/issue21764> ___ ___ Python-bugs-list m

[issue21764] Document that IOBase.__del__ calls self.close

2014-06-14 Thread Nikolaus Rath
Changes by Nikolaus Rath : Added file: http://bugs.python.org/file35638/iobase2.diff ___ Python tracker <http://bugs.python.org/issue21764> ___ ___ Python-bugs-list mailin

[issue20578] BufferedIOBase.readinto1 is missing

2014-06-15 Thread Nikolaus Rath
Nikolaus Rath added the comment: As discussed on python-devel, I'm attaching a new patch that uses memoryview.cast to ensure that the pure-Python readinto() now works with any object implementing the buffer protocol. -- Added file: http://bugs.python.org/file35647/issue20578_r5

[issue21763] Clarify requirements for file-like objects

2014-06-15 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 06/15/2014 08:29 AM, R. David Murray wrote: > I don't think that's true, though. "file like" pretty much means "has the > file attributes that I actually use". That is, it is context dependent (duck > typing). Well,

[issue20578] BufferedIOBase.readinto1 is missing

2014-06-15 Thread Nikolaus Rath
Nikolaus Rath added the comment: (refreshed patch, no changes) -- Added file: http://bugs.python.org/file35648/issue20578_r6.diff ___ Python tracker <http://bugs.python.org/issue20

[issue21763] Clarify requirements for file-like objects

2014-06-15 Thread Nikolaus Rath
Nikolaus Rath added the comment: Maybe I'm missing some important point here, but I think that the documentation ought to tell me how I have to design a file-like object such that it fulfills all expectations of the standard library. Yes, you can get away with less than that in

[issue21763] Clarify requirements for file-like objects

2014-06-16 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 06/15/2014 06:26 PM, Raymond Hettinger wrote: > Before creating more tracker items, please take time to learn about how > Python's history, [...] It'd be nice if you would have at least followed the link to http://article.gmane.org/gmane.c

[issue21763] Clarify requirements for file-like objects

2014-06-17 Thread Nikolaus Rath
Nikolaus Rath added the comment: "R. David Murray" writes: > R. David Murray added the comment: > > Nikolaus: while I agree that Raymond's comments were a bit strongly > worded, it doesn't read to me as if the thread you link to is on point > for this

[issue21763] Clarify requirements for file-like objects

2014-06-17 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 06/17/2014 01:28 PM, R. David Murray wrote: > Well, but we think it's pretty clear. This wasn't the impression that I had from the thread on python-devel, but I'll accept your judgement on that. I'll be more restrained when being asked

[issue15633] httplib.response is not closed after all data has been read

2013-01-29 Thread Nikolaus Rath
Nikolaus Rath added the comment: Alright, it *finally* happened again. Attributes of the response object are: ._method: GET, .chunked: 0, .length: 9369540 .chunk_left: UNKNOWN, .status: 200 .reason "OK", .version: 11, .will_cl

[issue15633] httplib.response is not closed after all data has been read

2013-02-02 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 01/29/2013 11:23 PM, Antoine Pitrou wrote: > "length: 9369540" indicates you haven't read the whole advertised > Content-Length. Is it possible the server shuts down the TCP connection even > before the whole Content-Length has been

[issue19044] getaddrinfo raises near-useless exception

2013-09-18 Thread Nikolaus Rath
New submission from Nikolaus Rath: I received a bugreport for a Python application that contains the following stacktrace: > File "/usr/lib/python3.3/http/client.py", line 1057, in endheaders > self._send_output(message_body) > File "/usr/lib/python3.3/http/

[issue19414] OrderedDict.values() behavior for modified instance

2013-10-26 Thread Nikolaus Rath
New submission from Nikolaus Rath: The documentation says the following about modifying a dict while iterating through its view: | Iterating views while adding or deleting entries in the dictionary may | raise a RuntimeError or fail to iterate over all entries. (http://docs.python.org/3/library

[issue19414] OrderedDict.values() behavior for modified instance

2013-10-26 Thread Nikolaus Rath
Nikolaus Rath added the comment: After thinking about this a bit more, I think this is actually a true bug in OrderedDict(), and only option (a) or be (b) really fix it. Rationale: I would expect that for any OrderedDict d, and any function modify_dict(d), the following assertion holds: for

[issue18861] Problems with recursive automatic exception chaining

2013-10-26 Thread Nikolaus Rath
Nikolaus Rath added the comment: *ping* No one any comments on this at all? -- ___ Python tracker <http://bugs.python.org/issue18861> ___ ___ Python-bugs-list m

[issue18861] Problems with recursive automatic exception chaining

2013-10-27 Thread Nikolaus Rath
Nikolaus Rath added the comment: Benjamin: I think that in most cases the intention of a ".. from None" is to disable printing of a stack trace for a specific exception when it occurs in the try .. except block. (In the example, that would be suppressing the stacktrace for t

[issue19414] OrderedDict.values() behavior for modified instance

2013-10-27 Thread Nikolaus Rath
Nikolaus Rath added the comment: Being able to modify an OrderedDict while iterating through it is pretty useful though. What about documenting that modifying an OrderedDict is allowed, but may cause iteration to skip or repeat items (but do not allow it to raise RuntimeError)? As far as I

[issue19414] OrderedDict.values() behavior for modified instance

2013-10-27 Thread Nikolaus Rath
Nikolaus Rath added the comment: I'd be happy to provide a more extensive patch along the lines Armin suggested if that is considered a good idea (not sure who has to make that decision). -- ___ Python tracker <http://bugs.python.org/is

[issue19414] OrderedDict.values() behavior for modified instance

2013-10-30 Thread Nikolaus Rath
Nikolaus Rath added the comment: I agree that OrderedDict is more a dict than a list, but it is not clear to me why this means that it cannot extend a dict's functionality in that respect. OrderedDict already adds functionality to dict (preserving the order), so why shouldn't it

[issue19414] OrderedDict.values() behavior for modified instance

2013-10-30 Thread Nikolaus Rath
Nikolaus Rath added the comment: The workaround is trivial, but there is no technical necessity for it, and it involves copying the entire dict into a list purely for.. what exactly? I guess I do not understand the drawback of allowing changes. What is wrong with for key in ordered_dict

[issue19414] OrderedDict.values() behavior for modified instance

2013-10-30 Thread Nikolaus Rath
Nikolaus Rath added the comment: Ethan: when you say "..the more there is to remember", what exactly do you mean? I can see that it is important to remember that you're *not allowed* to make changes during iteration for a regular dict. But is there really a significant cogniti

[issue19414] OrderedDict.values() behavior for modified instance

2013-10-30 Thread Nikolaus Rath
Nikolaus Rath added the comment: Hmm. I see your point. You might be right (I'm not fully convinced yet though), but this bug is probably not a good place to go into more detail about this. So what would be the best way to fix the immediate problem this was originally about? Ra

[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances

2013-10-30 Thread Nikolaus Rath
Changes by Nikolaus Rath : -- title: OrderedDict.values() behavior for modified instance -> iter(ordered_dict) yields keys not in dict in some circumstances ___ Python tracker <http://bugs.python.org/issu

[issue18861] Problems with recursive automatic exception chaining

2013-11-10 Thread Nikolaus Rath
Nikolaus Rath added the comment: Hi Nick, I am interested in working on this, but I have never worked on the C parts of cpython before. Do you think this is a feasible project to start with? To me it looks a bit daunting, I'd certainly need some mentoring to even know where to start

[issue15955] gzip, bz2, lzma: add option to limit output size

2014-08-11 Thread Nikolaus Rath
Nikolaus Rath added the comment: *ping* -- ___ Python tracker <http://bugs.python.org/issue15955> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22499] [SSL: BAD_WRITE_RETRY] bad write retry in _ssl.c:1636

2014-09-25 Thread Nikolaus Rath
New submission from Nikolaus Rath: I received a bugreport due to a crash when calling SSLObject.send(). The traceback ends with: [...] File "/usr/local/lib/python3.4/dist-packages/dugong-3.2-py3.4.egg/dugong/__init__.py", line 584, in _co_send len_ = self._sock.send(buf)

[issue7776] http.client.HTTPConnection tunneling is broken

2014-01-07 Thread Nikolaus Rath
Nikolaus Rath added the comment: Ok, this is a bit of a mess. Issue #11448 contains a patch for the documentation. But the functionality itself is still not working. With the (I believe) intended usage, we have: >>> import http.client >>> conn = http.client.HTTPSConnectio

[issue7776] http.client.HTTPConnection tunneling is broken

2014-01-07 Thread Nikolaus Rath
Nikolaus Rath added the comment: I have attached a patch that should fix the issue. -- keywords: +patch Added file: http://bugs.python.org/file33357/issue7776.diff ___ Python tracker <http://bugs.python.org/issue7

[issue7776] http.client.HTTPConnection tunneling is broken

2014-01-07 Thread Nikolaus Rath
Nikolaus Rath added the comment: New patch revision, this time includes unit tests. -- Added file: http://bugs.python.org/file33358/issue7776_rev1.diff ___ Python tracker <http://bugs.python.org/issue7

[issue10983] Errors in http.client.HTTPConnection class (python3)

2014-01-07 Thread Nikolaus Rath
Nikolaus Rath added the comment: There were actually a few additional bugs. I fixed them, and added testcases, in issue 7776. -- nosy: +Nikratio ___ Python tracker <http://bugs.python.org/issue10

[issue11448] docs for HTTPConnection.set_tunnel are ambiguous

2014-01-07 Thread Nikolaus Rath
Nikolaus Rath added the comment: Is there anything that needs to be done to get this patch applied? It would be nice if this could be committed together with the patch in issue 7776. -- nosy: +Nikratio ___ Python tracker <http://bugs.python.

[issue11448] docs for HTTPConnection.set_tunnel are ambiguous

2014-01-07 Thread Nikolaus Rath
Changes by Nikolaus Rath : -- type: -> enhancement versions: +Python 3.4, Python 3.5 ___ Python tracker <http://bugs.python.org/issue11448> ___ ___ Python-

[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances

2014-01-07 Thread Nikolaus Rath
Nikolaus Rath added the comment: I have attached a patch that fixes this issue. Looking at Raymonds comments in issue 19332, I have kept new code out of the critical path in __iter__ and instead modified the __delitem__ method (I assume that an element is removed only once, but may be

<    1   2   3   4   >