[issue23410] Document more BaseHTTPRequestHandler attributes

2015-02-08 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file38042/http-attributes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23410

[issue18885] handle EINTR in the stdlib

2015-02-07 Thread Martin Panter
Martin Panter added the comment: See also Issue 23285 for the PEP -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18885 ___ ___ Python-bugs-list

[issue23285] PEP 475 - EINTR handling

2015-02-07 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23285 ___ ___ Python-bugs-list

[issue21793] httplib client/server status refactor

2015-02-07 Thread Martin Panter
Martin Panter added the comment: Currently the log output includes the new HTTPStatus codes. I don’t care much for the log output, but perhaps this wasn’t part of the plan? Before: $ python3.4 -m http.server Serving HTTP on 0.0.0.0 port 8000 ... 127.0.0.1 - - [08/Feb/2015 05:05:28] GET / HTTP

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-02-07 Thread Martin Panter
Martin Panter added the comment: If it would help the review process, I could simplify my patch by dropping the addition of the HTTPConnection.closed flag, so that it just adds the ConnectionClosed exception. Looking forwards, I’m wondering if it might be better to add something like

[issue18885] handle EINTR in the stdlib

2015-02-07 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18885 ___ ___ Python-bugs-list

[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-02-07 Thread Martin Panter
Martin Panter added the comment: Here is a patch to redocument the constructor arguments. I am assuming that they were only removed by accident. The constructor arguments are already tested in ExceptionTests.testAttributes() at Lib/test/test_exceptions.py:248. I did not restore the bit about

[issue13637] binascii.a2b_* functions could accept unicode strings

2015-02-07 Thread Martin Panter
Martin Panter added the comment: The error fix patch looks good. I updated the doc patch as fix_doc_binascii_unhexlify.v2.patch, which also clarifies a2b_qp(), and restores the description of Python 3.2 not allowing text strings. -- assignee: - docs@python components: +Documentation

[issue23411] Update urllib.parse.__all__

2015-02-08 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: Added file: http://bugs.python.org/file38045/urllib.parse-all.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23411

[issue3213] pydoc -p should listen to [::] if IPv6 is supported

2015-02-08 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3213 ___ ___ Python-bugs-list

[issue23411] Update urllib.parse.__all__

2015-02-08 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: Removed file: http://bugs.python.org/file38044/urllib.parse-all.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23411

[issue23411] Update urllib.parse.__all__

2015-02-08 Thread Martin Panter
New submission from Martin Panter: +DefragResult, ParseResult, SplitResult, +DefragResultBytes, ParseResultBytes, SplitResultBytes] Also adds test case. -- components: Library (Lib) files: urllib.parse-all.patch keywords: patch messages: 235556 nosy: vadmium priority: normal severity

[issue12304] expose signalfd(2) in the signal module

2015-02-07 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12304 ___ ___ Python-bugs-list

[issue20611] socket.create_connection() doesn't handle EINTR properly

2015-02-07 Thread Martin Panter
Martin Panter added the comment: See also PEP 475 and Issue 23285 for the general fix in Python 3 -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20611

[issue10697] host and port attributes not documented well in function urllib.parse.urlparse and urlsplit

2015-02-08 Thread Martin Panter
Martin Panter added the comment: I don’t understand where the work needs to be done for this one. Even in the 3.1 and 2.7 documentation, the urlparse() and urlsplit() entries both list “port” as one of the returned attributes, and urlparse() has example code for it. -- nosy: +vadmium

[issue15009] urlsplit can't round-trip relative-host urls.

2015-02-08 Thread Martin Panter
Martin Panter added the comment: Fixing Issue 22852 or Issue 5843 should help fixing this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15009

[issue23418] Keep http.server.__all__ up to date

2015-02-08 Thread Martin Panter
New submission from Martin Panter: Here is a patch that adds the Simple/CGIHTTPRequestHandler classes to __all__, and a test case that should help keep it up to date in the future. -- components: Library (Lib) files: http.server-all.patch keywords: patch messages: 235594 nosy: vadmium

[issue23328] urllib2 fails for proxy credentials that contain a '/' character

2015-02-08 Thread Martin Panter
Martin Panter added the comment: The relevant code looks like it is _parse_proxy() at Lib/urllib/request.py:693. It has custom code to search for a slash (/), so it wouldn’t be hard to make it search after the last at (@) symbol. (I previously assumed it would use urlsplit() or similar, which

[issue12955] urllib.request example should use with ... as:

2015-02-08 Thread Martin Panter
Martin Panter added the comment: Issue 22755 is about the example arms race for contextlib.closing(). -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12955

[issue5804] Add an 'offset' argument to zlib.decompress

2015-01-14 Thread Martin Panter
Martin Panter added the comment: A different test case for “unused_data” attribute was added in 2012 for Issue 16350, so that part is no longer needed. If this feature goes ahead, it might be nice to also update the bzip and LZMA modules for consistency. In Python 3, the equivalent

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-15 Thread Martin Panter
Martin Panter added the comment: I opened Issue 23231 about fixing iterencode() and iterdecode() in the general case. I added a patch to Issue 13881 to fix StreamWriter for zlib and bz2, and to fix StreamWriter.writelines() in general. I am adding a patch here to clarify the StreamReader API

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-15 Thread Martin Panter
Martin Panter added the comment: My “master plan” is basically to make most of the bytes-to-bytes codecs work as documented in the incremental (stateful) modes. I’m less interested in fixing the text codecs, and the quopri and uu codecs might be too hard, so I was going to propose some

[issue13881] Stream encoder for zlib_codec doesn't use the incremental encoder

2015-01-15 Thread Martin Panter
Martin Panter added the comment: Sorry, I changed the name of the attribute and forgot to update the doc string. Its new name was _Encoder. Your description was fairly accurate. I am adding patch v3, with an expanded the doc string. Hopefully that explains it a bit better. Since it is just

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-01-19 Thread Martin Panter
Martin Panter added the comment: Hi Demian, my intention is to demonstrate normal usage of Python’s HTTP client, whether or not its implementation misbehaves. I am trying to demonstrate a valid persistent server that happens to decide to close the connection after the first request but before

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-01-19 Thread Martin Panter
Martin Panter added the comment: Calling self.wfile.write(b) should be equivalent to not calling write() at all, as far as I understand. Using strace, it does not seem to invoke send() at all. So the result will depend on what is written next. In the case of my code, nothing is written next

[issue20121] quopri_codec newline handling

2015-01-19 Thread Martin Panter
Martin Panter added the comment: Here is patch v2, which fixes some more bugs I uncovered in the quoted-printable encoders: * The binascii version would unnecessarily break a 76-character line (maximum length) if it would end with an =XX escape code * The native Python version would insert

[issue17840] base64_codec uses assert for runtime validity checks

2015-01-18 Thread Martin Panter
Martin Panter added the comment: Would also be good to document that errors='ignored' is not allowed. Currently the documentation says The following string values are defined and implemented by all standard Python codecs: * 'strict' * 'ignore

[issue17840] base64_codec uses assert for runtime validity checks

2015-01-18 Thread Martin Panter
Martin Panter added the comment: Is this patch likely to go ahead? It has been sitting around a while and would conflict with patches I am working on. If so, I reckon it would be good to factor out some of the new bits of code (_check_strict, _StrictErrors) into a common place, like

[issue21869] Clean up quopri, correct method names encodestring and decodestring

2015-01-18 Thread Martin Panter
Martin Panter added the comment: Personally I don’t have a problem with the names; I would consider str(), bytes(), bytearray() types all to be “strings”. However there is precedent in the “base64” module for renaming to en/decodebytes(); see Issue 3613. -- nosy: +vadmium

[issue16473] quopri module differences in quoted-printable text with whitespace

2015-01-18 Thread Martin Panter
Martin Panter added the comment: Three slightly different points here: 1. Decoding trailing whitespace: My understanding is quoted-printable encoding aims to be tolerant of whitespace being added to and removed from the end of encoded lines. So I assume the “binascii” module is wrong to leave

[issue16473] quopri module differences in quoted-printable text with whitespace

2015-01-18 Thread Martin Panter
Martin Panter added the comment: Regarding decoding trailing whitespace, https://tools.ietf.org/html/rfc1521.html#section-5.1 rule #3 says: “When decoding a Quoted-Printable body, any trailing white space on a line must be deleted, as it will necessarily have been added by intermediate

[issue1508475] transparent gzip compression in urllib

2015-01-20 Thread Martin Panter
Martin Panter added the comment: The Lib/xmlrpc/client.py file appears to already support compression using “Content-Encoding: gzip”. Perhaps it could be leveraged for any work on this issue. -- ___ Python tracker rep...@bugs.python.org http

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-01-19 Thread Martin Panter
Martin Panter added the comment: Yeah I’m happy to put a patch together, once I have an idea of the details. I’d also like to understand your scenario that would mislead the user to believe that the connection has been closed when it actually hasn’t. Can you give a concrete example

[issue23275] Can assign [] = (), but not () = []

2015-01-20 Thread Martin Panter
Martin Panter added the comment: But () is the odd one out if you consider [a, b] = range(2) [] = range(0) (a, b) = range(2) () = range(0) File stdin, line 1 SyntaxError: can't assign to () -- nosy: +vadmium ___ Python tracker rep

[issue20898] Missing 507 response description

2015-01-19 Thread Martin Panter
Martin Panter added the comment: Just noticed the new documentation says “http.HTTPStatus.OK is also available as . . . http.server.OK”. I think this is wrong; only the client module (and now the top-level package) have those constants. The enum values are only available in the server module

[issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode()

2015-01-17 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18022 ___ ___ Python-bugs-list

[issue23255] SimpleHTTPRequestHandler refactor for more extensible usage.

2015-01-17 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23255 ___ ___ Python-bugs-list

[issue23231] Fix codecs.iterencode/decode() by allowing data parameter to be omitted

2015-01-17 Thread Martin Panter
Martin Panter added the comment: Another idea that doesn’t involve changing the incremental codec APIs is kind of described in https://bugs.python.org/issue7475#msg145986: to add format parameters to iterencode() and iterdecode(), which would allow it to determine the right data type

[issue20121] quopri_codec newline handling

2015-01-17 Thread Martin Panter
Martin Panter added the comment: Here is a patch that clarifies in the documentation and test suite how newlines work in the “quopri” and “binascii” modules. It also fixes the native Python implementation to support CRLFs. * \n is used by default (e.g. for soft line breaks if the input has

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-01-15 Thread Martin Panter
Martin Panter added the comment: I believe the BadStatusLine can still happen, depending on the circumstances. When I get a chance I will see if I can make a demonstration. In the meantime these comments from my persistent connection handler https://github.com/vadmium/python-iview/blob

[issue13881] Stream encoder for zlib_codec doesn't use the incremental encoder

2015-01-14 Thread Martin Panter
Martin Panter added the comment: New patch that also fixes StreamWriter.writelines() in general for the byte codecs -- Added file: http://bugs.python.org/file37710/zlib-bz2-writer.v2.patch ___ Python tracker rep...@bugs.python.org http

[issue17546] Document the circumstances where the locals() dict get updated

2015-01-15 Thread Martin Panter
Martin Panter added the comment: What about instead of ''' Whether changes to one are reflected in the other after the call returns is undefined; additionally, the dictionary may change unpredictably after the call, and how it does is implementation-specific. ''' substitue this wording

[issue18986] Add a case-insensitive case-preserving dict

2015-01-15 Thread Martin Panter
Martin Panter added the comment: For the record, this is related to PEP 455 (key-transforming dictionary) -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18986

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-01-18 Thread Martin Panter
Martin Panter added the comment: Spotted code in Python’s own library that maintains a persistent connection and works around this issue: Lib/xmlrpc/client.py:1142 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3566

[issue16648] stdib should use new exception types from PEP 3151

2015-01-18 Thread Martin Panter
Martin Panter added the comment: I would support adding ENOTCONN under the ConnectionError umbrella. It is caught for shutdown() calls in a few standard library modules. Here is a demo showing how to trigger it (at least on Linux): from socket import create_connection, SHUT_RDWR from

[issue23247] Multibyte codec StreamWriter.reset() crashes

2015-01-15 Thread Martin Panter
New submission from Martin Panter: $ python3 -c 'import codecs; from io import BytesIO; codecs.getwriter(big5)(BytesIO()).reset()' Segmentation fault (core dumped) [Exit 139] Happens for all the multibyte codecs: broken_stream_codecs = { big5, big5hkscs, cp932, cp949, cp950, euc_jp

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-16 Thread Martin Panter
Martin Panter added the comment: There is a flaw with inheriting the readline() method in my patch, and I have decided to give up fixing the StreamReader classes. I did update the documentation in my copy of the patch based on Marc-Andre Lemburg’s feedback if anyone is interested

[issue23251] mention in time.sleep() docs that it does not block other Python threads

2015-01-16 Thread Martin Panter
Martin Panter added the comment: There is also a new sentence about the GIL at the end, but leaving the inbetween lines as they were would verify this -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23251

[issue23251] mention in time.sleep() docs that it does not block other Python threads

2015-01-16 Thread Martin Panter
Martin Panter added the comment: What I have sometimes done in this situation is just break the overly long line into two short lines -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23251

[issue15608] Improve socketserver doc

2015-01-16 Thread Martin Panter
Martin Panter added the comment: The post makes a bit more sense once you realize the dotted numbers refer to old section numbers (which have moved on now): 20.19.2 → “Server Objects” section 20.19.1 → “Server Creation Notes” Regarding point 2: Instructions for the user to make a threading

[issue14307] Make subclassing SocketServer simpler for non-blocking frameworks

2015-01-16 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14307 ___ ___ Python-bugs-list

[issue1429] FD leak in SocketServer when request handler throws exception

2015-01-16 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- title: FD leak in SocketServer - FD leak in SocketServer when request handler throws exception ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1429

[issue13354] tcpserver should document non-threaded long-living connections

2015-01-16 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13354 ___ ___ Python-bugs-list

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

2015-01-16 Thread Martin Panter
Martin Panter added the comment: Adding issue15955_lzma_r5.diff. Main changes from r4: * Consistent Py_ssize_t type for data_size * max_size → max_length to match Python parameter name * Arranged for EOF handling to occur before, and instead of, saving the input buffer * Removed my LZMAFile

[issue23254] Document how to close the TCPServer listening socket

2015-01-16 Thread Martin Panter
New submission from Martin Panter: Running the example from the Asynchronous Mixins section of the “socketserver” documentation generates a ResourceWarning: $ ./python -btWall ThreadedTCPServer.py Server loop running in thread: Thread-1 Received: Thread-2: Hello World 1 Received: Thread-3

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-01-16 Thread Martin Panter
Martin Panter added the comment: Okay here is a demonstration script, which does two tests: a short basic GET request, and a 2 MB POST request. Output for me is usually: Platform: Linux-3.15.5-2-ARCH-x86_64-with-arch Normal request: getresponse() raised BadStatusLine('',) 2 MB request: request

[issue20420] BufferedIncrementalEncoder violates IncrementalEncoder interface

2015-01-17 Thread Martin Panter
Martin Panter added the comment: For what it’s worth, both io.TextIOWrapper and _pyio.TextIOWrapper appear to only ever call IncrementalEncoder.setstate(0). And the newline _decoder_ is not relevant because it doesn’t use any _encoder_. -- nosy: +vadmium

[issue23302] Small fixes around the use of TCP MSS in http.client

2015-01-22 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23302 ___ ___ Python-bugs-list

[issue23439] Fixed http.client.__all__ and added a test

2015-02-11 Thread Martin Panter
Martin Panter added the comment: Actually, maybe I should add all those status codes as well, like http.client.OK. Will probably require different patches for 3.4 and 3.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23448] urllib2 needs to remove scope from IPv6 address when creating Host header

2015-02-11 Thread Martin Panter
Martin Panter added the comment: I’m no IPv6 expert, but there seems to be a few standards: * https://tools.ietf.org/html/rfc6874 (Feb 2013). Encodes as http://[fe80::1%25eth0]/; says Windows uses this form. Also mentions the unencoded http://[fe80::1%eth0]/ form. Says that the HTTP Host

[issue18304] ElementTree -- provide a way to ignore namespace in tags and seaches

2015-02-10 Thread Martin Panter
Martin Panter added the comment: See Issue 8583 for a proposal that would apparently allow all namespaces to be ignored -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18304

[issue8583] Hardcoded namespace_separator in the cElementTree.XMLParser

2015-02-10 Thread Martin Panter
Martin Panter added the comment: Also Issue 18304 for more discussion on simplifying namespaces -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8583

[issue18986] Add a case-insensitive case-preserving dict

2015-02-17 Thread Martin Panter
Martin Panter added the comment: I will be interested to see those reasons. Another way to do a similar thing might be using a Key(value, transform) class, somewhat along the lines of Issue 20632, but as a separate class rather than part of the core type system. But I have not thought

[issue23479] str.format() breaks object duck typing

2015-02-18 Thread Martin Panter
Martin Panter added the comment: My guess is you could make it work by adding a __format__ method to your custom class. def __format__(self, format_spec): return format(float(self), format_spec) -- nosy: +vadmium ___ Python tracker rep

[issue23480] Minor typo

2015-02-18 Thread Martin Panter
Martin Panter added the comment: It returns a string, and the print statement/function prints the contents of that string. Perhaps you are confused between JSON strings, which appear in the output, and Python strings, which hold the characters to output. -- nosy: +vadmium

[issue23453] Opening a stream with tarfile.open() triggers a TypeError: can't concat bytes to str error

2015-02-12 Thread Martin Panter
Martin Panter added the comment: Using fileobj=sys.stdin.buffer instead should do the trick. The “tarfile” module would expect a binary stream, not a text stream. Given the documentation currently says, “Use this variant in combination with e.g. sys.stdin, . . .”, I presume that is why you

[issue20699] Behavior of ZipFile with file-like object and BufferedWriter.

2015-02-12 Thread Martin Panter
Martin Panter added the comment: Posting patch v2: * Changed readinto() argument descriptions to “a pre-allocated, writable bytes-like buffer”, for both RawIOBase and BufferedIOBase * Integrated the single-use test_memoryio.BytesIOMixin test class, which tricked me when I did the first patch

[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Martin Panter
Martin Panter added the comment: Thanks. Confirming the patch fixes the problem for me, so should be comitted. I wonder if a test case would be good too though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23442

[issue23439] Fixed http.client.__all__ and added a test

2015-02-12 Thread Martin Panter
Martin Panter added the comment: I don’t have a strong opinion about changing __all__ in these cases. I only noticed the potential problem when I went to add a new class to the module, and thought this was common practice. If we leave it as it is, it would be good to add comment in the source

[issue17986] Alternative async subprocesses (pep 3145)

2015-02-12 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17986 ___ ___ Python-bugs-list

[issue23350] Content-length is incorrect when request body is a list or tuple

2015-02-12 Thread Martin Panter
Martin Panter added the comment: The length of an encoded Latin-1 string should equal the length of the unencoded text string, since it is a one-to-one character-to-byte encoding. So encoding should not actually be needed to determine the Latin-1 encoded length. Though I’m not particularly

[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data

2015-02-14 Thread Martin Panter
Martin Panter added the comment: One interesting question is how to convey data to the chunked encoder. There are two sets of options in my mind, a pull interface: * iterable: seems to be the popular way amoung commenters here * file reader object: encoder calls into stream’s read() method

[issue23410] Document more BaseHTTPRequestHandler attributes

2015-02-14 Thread Martin Panter
Martin Panter added the comment: Posting another patch which hopefully explains the “requestline” attribute a bit better. Let me know if you have any ideas for better wording. -- Added file: http://bugs.python.org/file38141/http-attributes.v2.patch

[issue23430] socketserver.BaseServer.handle_error() should not catch exiting exceptions

2015-02-14 Thread Martin Panter
Martin Panter added the comment: Looking at this again, I think I should make the forking server’s handle_error() method only be called for Exception subclasses as well. So I am posting a new patch that also does this. -- Added file: http://bugs.python.org/file38144/socketserver

[issue5054] CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed

2015-02-14 Thread Martin Panter
Martin Panter added the comment: Posting a patch for this so that we can get rid of the broken HTTPMessage.getallmatchingheaders() method in Issue 5053. -- keywords: +patch nosy: +vadmium Added file: http://bugs.python.org/file38142/cgi-accept.patch

[issue5053] http.client.HTTPMessage.getallmatchingheaders() always returns []

2015-02-14 Thread Martin Panter
Martin Panter added the comment: Posting a patch to remove the entire HTTPMessage class. This assumes my patch for Issue 5054 is accepted, which will remove the only existing reference to getallmatchingheaders(). -- Added file: http://bugs.python.org/file38143/remove-HTTPMessage.patch

[issue19985] Not so correct error message when initializing Struct with ill argument

2015-02-16 Thread Martin Panter
Martin Panter added the comment: Closely related: * Issue 16349: document byte string format argument support * Issue 21071: should the Struct.format property be bytes or text? -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http

[issue22928] HTTP header injection in urrlib2/urllib/httplib/http.client

2015-02-16 Thread Martin Panter
Martin Panter added the comment: But it is not natural to do things like this (based on headers sent by Firefox): putheader(User-Agent, Mozilla/5.0, (X11;, Linux, x86_64;, rv:25.0), Gecko/20100101, Firefox/25.0) putheader(Accept-Encoding, gzip,, deflate) A way to properly encode different

[issue22834] Unexpected FileNotFoundError when current directory is removed

2015-02-16 Thread Martin Panter
Martin Panter added the comment: I don’t have a Solaris to test this, but maybe changing the first half of the test to the following would work: dir = tempfile.TemporaryDirectory() self.addCleanup(dir.cleanup) # In case removal after chdir() fails self.addCleanup(os.chdir, os.getcwd

[issue23410] Document more BaseHTTPRequestHandler attributes

2015-02-16 Thread Martin Panter
Martin Panter added the comment: Posting patch v3. It is based on Demian’s suggested wording for the requestline attribute, but adjusted to match the other entries, and to mention the empty string. -- Added file: http://bugs.python.org/file38157/http-attributes.v3.patch

[issue22000] cross type comparisons clarification

2015-02-19 Thread Martin Panter
Martin Panter added the comment: I think the patch for Issue 12067 covers all of the suggested points here, and is more accurate in some cases. -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22000

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-02-19 Thread Martin Panter
Martin Panter added the comment: I guess you saying RemoteDisconnected effectively means the same thing as ConnectionResetError. Would it help if it was derived from ConnectionResetError, instead of the ConnectionError base class? Or are you also worried about the multiple inheritance

[issue23439] Fixed http.client.__all__ and added a test

2015-02-19 Thread Martin Panter
Martin Panter added the comment: Posting v3 patch that changes from a list to a set of expected API names -- Added file: http://bugs.python.org/file38180/http.client-all.v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue20699] Document that binary IO classes work with bytes-likes objects

2015-02-19 Thread Martin Panter
Martin Panter added the comment: Posting patch v3; thanks for the reviews! * Changed “buffer” → “object” * Made it clearer that the bytes-like object generalization only applies to method arguments, not return values * Minor fixes to wording -- Added file: http://bugs.python.org

[issue12067] Doc: remove errors about mixed-type comparisons.

2015-02-20 Thread Martin Panter
Martin Panter added the comment: Issue 4395 is already open for the != delegating to __eq__ issue that Guido pointed out earlier. Yet another issue that this doc patch should solve: Issue 22000. I am posting v13 of the patch that works with the current “default” (3.5) branch. Minor

[issue20699] Document that binary IO classes work with bytes-likes objects

2015-02-20 Thread Martin Panter
Martin Panter added the comment: Using len(b) is fine if b is a bytes() or bytearray() object, but a bytes-like object can be anything that you can pass to memoryview(). In general len(b) is not part of that protocol, so can return some other value, or even be unimplemented: from array

[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2015-01-27 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14465 ___ ___ Python-bugs-list

[issue23342] run() - unified high-level interface for subprocess

2015-01-28 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23342 ___ ___ Python-bugs-list

[issue22989] HTTPResponse.msg not as documented

2015-01-28 Thread Martin Panter
Martin Panter added the comment: Documenting the “headers” attribute is also discussed in Issue 12707 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22989

[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2015-01-28 Thread Martin Panter
Martin Panter added the comment: Related: Issue 12707, about deprecating some methods in favour of attributes -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21228

[issue12707] Deprecate addinfourl getters

2015-01-28 Thread Martin Panter
Martin Panter added the comment: I think it would be okay to deprecate the methods in the documentation, but they should not be removed nor trigger warnings any time soon. Currently the following related methods and attributes are documented: * addinfourl.getcode() == HTTPResponse.status

[issue12707] Deprecate addinfourl getters

2015-01-28 Thread Martin Panter
Martin Panter added the comment: Blessing a geturl() method or “url” attribute on HTTPError might require Issue 13567 to be fixed -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12707

[issue23350] Content-length is incorrect when request body is a list or tuple

2015-01-30 Thread Martin Panter
Martin Panter added the comment: Sorry my comment was a bit rushed. I wasn’t saying this feature shouldn’t be added. I guess I was pointing out two things: 1. Someone should updated the documentation to say that Content-Length no longer has to be explicitly provided for lists and tuples. 2

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

2015-01-30 Thread Martin Panter
Martin Panter added the comment: Nikolaus, do you still plan on doing the bzip module? If not, I could have a go when I get a chance. I’m also keen for the GzipFile decompression to be fixed, if anyone wants to review my gzip-bomb.patch

[issue23326] Remove redundant __ne__ implementations

2015-01-31 Thread Martin Panter
Martin Panter added the comment: I looked at all the instances of __ne__() identified in the patch, and they all seem redundant with the __eq__() implementations, so I think this patch is good. -- ___ Python tracker rep...@bugs.python.org http

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-01-24 Thread Martin Panter
Martin Panter added the comment: Updated v2 patch. This version avoids intruding into the HTTPConnection.connect() implementation, so that users, tests, etc may still set the undocumented “sock” attribute without calling the base connect() method. Also code style changes based on feedback

[issue23232] 'codecs' module functionality + its docs -- concerning custom codecs, especially non-string ones

2015-01-24 Thread Martin Panter
Martin Panter added the comment: I am certainly no expert, but this is how I understand the three different kinds of codecs are used: * Stateless codecs: str.encode(), bytes.decode(), etc * Incremental codecs: TextIOWrapper, IncrementalNewlineDecoder * Stream codecs: only stuff inside

[issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used

2015-01-25 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17088 ___ ___ Python-bugs-list

[issue20132] Many incremental codecs don’t handle fragmented data

2015-01-24 Thread Martin Panter
Martin Panter added the comment: Here is a new patch which fixes the bytes-to-bytes incremental codecs. It depends on my patches for these other issues being applied first: * Issue 23231: Bytes-to-bytes support for iteren/decode() * Issue 13881: Generic StreamWriter from IncrementalEncoder

[issue21279] str.translate documentation incomplete

2015-01-24 Thread Martin Panter
Martin Panter added the comment: I’m happy with the new wording in v5. Maybe the docstring in the C module could be reflowed though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21279

<    1   2   3   4   5   6   7   8   9   10   >