[issue23334] http.client refactor

2015-01-27 Thread Demian Brecht
Demian Brecht added the comment: Attaching a file /with/ http.proto this time. -- ___ Python tracker <http://bugs.python.org/issue23334> ___ ___ Python-bugs-list m

[issue23334] http.client refactor

2015-01-27 Thread Demian Brecht
Changes by Demian Brecht : Added file: http://bugs.python.org/file37887/http_proto_1.patch ___ Python tracker <http://bugs.python.org/issue23334> ___ ___ Python-bug

[issue23334] http.client refactor

2015-01-28 Thread Demian Brecht
Demian Brecht added the comment: On 2015-01-27 7:34 PM, R. David Murray wrote: > Quantifying "largely" will be important. Understandably. In terms of the public API, all changes should be purely additive and 100% backwards compatible. "largely" is referring to some of t

[issue13128] httplib debuglevel on CONNECT doesn't print response headers

2015-01-28 Thread Demian Brecht
Demian Brecht added the comment: New patch removes unrelated changes. -- Added file: http://bugs.python.org/file37892/issue13128_3.patch ___ Python tracker <http://bugs.python.org/issue13

[issue23334] http.client refactor

2015-01-28 Thread Demian Brecht
Demian Brecht added the comment: On 2015-01-28 7:41 AM, R. David Murray wrote: > Although they are private interfaces we may decide we need a deprecation > release before dropping them. Sometimes what we do in cases like this is go > ahead and make the changes, but also provid

[issue22931] cookies with square brackets in value

2015-01-28 Thread Demian Brecht
Demian Brecht added the comment: Ping for review/commit. -- ___ Python tracker <http://bugs.python.org/issue22931> ___ ___ Python-bugs-list mailing list Unsub

[issue23334] http.client refactor

2015-01-29 Thread Demian Brecht
Demian Brecht added the comment: Digging into this more, I've opened up a can of worms that will result in http.client not looking nearly at all like http.client. I'll work this into httplib3 and will open this conversation back up if it gets any traction. -- resolution: -

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

2015-01-29 Thread Demian Brecht
New submission from Demian Brecht: Rather than summing the value of each element of a list or tuple to use as the value of the content-length header, the length of the list or tuple is used. -- files: list_content_length.patch keywords: patch messages: 235012 nosy: demian.brecht

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

2015-01-29 Thread Demian Brecht
Changes by Demian Brecht : -- components: +Library (Lib) type: -> behavior versions: +Python 3.5 ___ Python tracker <http://bugs.python.org/issue23350> ___ _

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

2015-01-29 Thread Demian Brecht
Demian Brecht added the comment: Updated patch based on review. -- Added file: http://bugs.python.org/file37915/list_content_length_1.patch ___ Python tracker <http://bugs.python.org/issue23

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

2015-01-30 Thread Demian Brecht
Demian Brecht added the comment: On 2015-01-29 9:51 PM, Martin Panter wrote: > The documentation currently says “Content-Length header should be explicitly > provided when the body is an iterable”. See Lib/urllib/request.py:1133 for > how it is done for urlopen(), using memoryview(),

[issue21793] httplib client/server status refactor

2015-02-09 Thread Demian Brecht
Demian Brecht added the comment: Thanks for the catch Martin, it definitely wasn't intended. I've added a patch to fix the issue and add the extra description as suggested by Ethan. -- Added file: http://bugs.python.org/file38068/issue21793_lo

[issue21793] httplib client/server status refactor

2015-02-10 Thread Demian Brecht
Demian Brecht added the comment: I’ve reverted the patch to use the old format. The main reason being that plain ints can still be used in most cases as values for code, in which case logging will be inconsistent with cases using the enum. -- Added file: http://bugs.python.org

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

2015-02-10 Thread Demian Brecht
Demian Brecht added the comment: My apologies for the delay, but I've now reviewed the proposed patch. With a fresh outlook after taking a bit of time off, I'm not sure anymore that this is the best way of going about solving this problem. The main reason being that we now have

[issue2211] Cookie.Morsel interface needs update

2015-02-10 Thread Demian Brecht
Demian Brecht added the comment: @Mark: Sure, but not super high priority. Thanks for pointing it out. -- ___ Python tracker <http://bugs.python.org/issue2

[issue23434] RFC6266 support

2015-02-10 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue23434> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2015-02-11 Thread Demian Brecht
Demian Brecht added the comment: > Thanks for helping with this Demian. No worries. This textual white boarding exercise has also been greatly valuable in getting my own head wrapped around various low frequency socket level errors that can be encountered when using the client. The downside

[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-11 Thread Demian Brecht
Demian Brecht added the comment: Thanks for the catch Martin, the field should indeed be updated to be plural. I'll try to get a patch for this later today unless someone else beats me to it -- ___ Python tracker <http://bugs.python.org/is

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

2015-02-11 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue23448> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2015-02-11 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue23439> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2015-02-11 Thread Demian Brecht
Demian Brecht added the comment: The only real question I have is: why? As far as I'm aware, these are implementation details of the http.client module (there's even a comment in HTTPMessage that it might make sense to move the class altogether). As far as the constants go, they

[issue10486] http.server doesn't set all CGI environment variables

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue10486> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Demian Brecht
Demian Brecht added the comment: The attached patch fixes the name -- keywords: +patch Added file: http://bugs.python.org/file38112/issue23442.patch ___ Python tracker <http://bugs.python.org/issue23

[issue9698] When reusing an handler, urllib(2)'s digest authentication fails after multiple regative replies

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue9698> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Demian Brecht
Demian Brecht added the comment: Thanks for the test Berker, I'll put a patch together with the changes later this afternoon. On 2015-02-12 2:27 PM, Berker Peksag wrote: > > Berker Peksag added the comment: > > He

[issue23442] http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5

2015-02-12 Thread Demian Brecht
Demian Brecht added the comment: I've attached a patch with fixes for both cases and the tests added by Berker. Thanks guys. -- Added file: http://bugs.python.org/file38122/issue23442_1.patch ___ Python tracker <http://bugs.python.org/is

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

2015-02-12 Thread Demian Brecht
Demian Brecht added the comment: > If we leave it as it is, it would be good to add comment in the source code > explaining this decision. I think that __all__ should be left as-is for the time being. Adding some comments around that decision makes sense to me to avoid any future con

[issue22147] PosixPath() constructor should not accept strings with embedded NUL bytes

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue22147> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12455] urllib2 forces title() on header names, breaking some requests

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue12455> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17908] Unittest runner needs an option to call gc.collect() after each test

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue17908> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12849] Cannot override 'connection: close' in urllib2 headers

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue12849> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8843] urllib2 Digest Authorization uri must match request URI

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue8843> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14301] xmlrpc client transport and threading problem

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue14301> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22946] urllib gives incorrect url after open when using HTTPS

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue22946> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21557] os.popen & os.system lack shell-related security warnings

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue21557> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22197] Allow better verbosity / output control in test cases

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue22197> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14044] IncompleteRead error with urllib2 or urllib.request -- fine with urllib, wget, or curl

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue14044> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14414] xmlrpclib leaves connection in broken state if server returns error without content-length

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue14414> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23043] doctest ignores "from __future__ import print_function"

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue23043> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23004] mock_open() should allow reading binary data

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue23004> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue23448> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23166] urllib2 ignores opener configuration under certain circumstances

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue23166> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9698] When reusing an handler, urllib(2)'s digest authentication fails after multiple regative replies

2015-02-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue9698> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2015-02-12 Thread Demian Brecht
Demian Brecht added the comment: Thanks for the clarification Martin. After giving this some further thought, I think that the best way to go is to /only/ calculate and add the Content-Length header if each element in the list or tuple is pre-encoded. If it's mixed or only strings, then

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

2015-02-13 Thread Demian Brecht
Demian Brecht added the comment: Thanks for the review Martin, I've addressed your comments. > 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. Once in a while, I want to stop wha

[issue23410] Document more BaseHTTPRequestHandler attributes

2015-02-13 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue23410> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23440] Extend http.server.SimpleHTTPRequestHandler testing

2015-02-13 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue23440> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2015-02-13 Thread Demian Brecht
Demian Brecht added the comment: > LGTM. +1 -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue23418> ___ ___ Python-bugs-list mai

[issue17229] unable to discover preferred HTTPConnection class

2015-02-13 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: -demian.brecht ___ Python tracker <http://bugs.python.org/issue17229> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2015-02-13 Thread Demian Brecht
Demian Brecht added the comment: Here's a patch addressing the potential vulnerability as reported. The patch should also bring the implementation up to date with the most recent standards around header names and values. > There could be potential for breaking compatibility if pe

[issue23440] Extend http.server.SimpleHTTPRequestHandler testing

2015-02-13 Thread Demian Brecht
Demian Brecht added the comment: LGTM -- versions: +Python 3.5 ___ Python tracker <http://bugs.python.org/issue23440> ___ ___ Python-bugs-list mailing list Unsub

[issue23410] Document more BaseHTTPRequestHandler attributes

2015-02-13 Thread Demian Brecht
Demian Brecht added the comment: Minor comment in Rietveld, otherwise LGTM. -- ___ Python tracker <http://bugs.python.org/issue23410> ___ ___ Python-bugs-list m

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

2015-02-13 Thread Demian Brecht
Demian Brecht added the comment: I think that keeping the public API as-is is the better way to go, at least for the shorter term given it won't require users to have to make code changes. Thanks for the catch on the docs though, will update

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

2015-02-16 Thread Demian Brecht
Demian Brecht added the comment: Some refactoring that I'm working on for http.client could use this (currently I have it as part of my patch set). I haven't run into any issues using it and it's definitely useful. Would be nice to get this merged. -- nosy:

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

2015-02-16 Thread Demian Brecht
Demian Brecht added the comment: > Maybe join them with tabs rather than spaces then, since it was previously > "\r\n\t". This way it is even closer to before. After thinking about this a little more, I think I'd prefer to keep spaces rather than tabs. The reason being is

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

2015-02-16 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue5053> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5054] CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed

2015-02-16 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue5054> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21257] Document parse_headers function of http.client

2015-02-16 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue21257> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2015-02-16 Thread Demian Brecht
Changes by Demian Brecht : -- versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issue22928> ___ ___ Python-bug

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

2015-02-16 Thread Demian Brecht
Demian Brecht added the comment: > But it is not natural to do things like this (based on headers sent by > Firefox) Good point. > Otherwise, retaining the one_value.encode('latin-1') call is confusing when > later on it rejects non-ASCII-encoded characters. I’m a l

[issue23410] Document more BaseHTTPRequestHandler attributes

2015-02-16 Thread Demian Brecht
Demian Brecht added the comment: LGTM -- ___ Python tracker <http://bugs.python.org/issue23410> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23410] Document more BaseHTTPRequestHandler attributes

2015-02-16 Thread Demian Brecht
Demian Brecht added the comment: Added Library component as there are a few newly added tests as well though and cosmetic changes were made to server.py. -- components: +Library (Lib) ___ Python tracker <http://bugs.python.org/issue23

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

2015-02-17 Thread Demian Brecht
Demian Brecht added the comment: I’ve updated the patch to include the latin-1 charset in legal header values. It still uses a space as delimiter, but all other comments should now be addressed. -- Added file: http://bugs.python.org/file38158/issue22928_2.patch

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

2015-02-18 Thread Demian Brecht
Demian Brecht added the comment: > I will be interested to see those reasons. +1. Something like what this PEP proposed would be beneficial in a few places throughout the library (header and cookie implementations would definitely benefit rather than having to deal with buggy normalizat

[issue2211] Cookie.Morsel interface needs update

2015-02-18 Thread Demian Brecht
Demian Brecht added the comment: The attached patch should cover the implementation/test aspects of this issue. I'll work on the documentation next. -- keywords: +patch versions: +Python 3.5 -Python 3.2 Added file: http://bugs.python.org/file38170/issue2211.

[issue2211] Cookie.Morsel interface needs update

2015-02-18 Thread Demian Brecht
Demian Brecht added the comment: Never mind, Morsel /is/ documented (at least in Docs). I imagine that the OP was after more detailed docstrings, but I don't believe they'd add much value. The patch should be good to go as-is. -- ___ Pyth

[issue21257] Document parse_headers function of http.client

2015-02-18 Thread Demian Brecht
Demian Brecht added the comment: Left a super minor comment in Rietveld, but otherwise LGTM. -- ___ Python tracker <http://bugs.python.org/issue21257> ___ ___

[issue21257] Document parse_headers function of http.client

2015-02-19 Thread Demian Brecht
Demian Brecht added the comment: Ignore my previous comment. It was intended for #23439. -- ___ Python tracker <http://bugs.python.org/issue21257> ___ ___ Pytho

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

2015-02-19 Thread Demian Brecht
Demian Brecht added the comment: Left a super minor comment in Rietveld, but otherwise LGTM. -- ___ Python tracker <http://bugs.python.org/issue23439> ___ ___

[issue21257] Document parse_headers function of http.client

2015-02-19 Thread Demian Brecht
Demian Brecht added the comment: And this really should likely now be closed as a duplicate of #23439. -- ___ Python tracker <http://bugs.python.org/issue21

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

2015-02-19 Thread Demian Brecht
Demian Brecht added the comment: Left a few minor comments in Rietveld. My only opposition to the RemoteDisconnected error is now we have two exceptions that effectively mean the same thing. It looks like asyncio.streams has similar behaviour: https://hg.python.org/cpython/file/041a27298cf3

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

2015-02-20 Thread Demian Brecht
Demian Brecht added the comment: > On Feb 19, 2015, at 8:08 PM, Martin Panter wrote: > I guess you saying RemoteDisconnected effectively means the same thing as > ConnectionResetError. Exactly. > Would it help if it was derived from ConnectionResetError, instead of the >

[issue21257] Document parse_headers function of http.client

2015-02-20 Thread Demian Brecht
Demian Brecht added the comment: > On Feb 20, 2015, at 3:10 AM, Berker Peksag wrote: > This is a different issue than #23439. BaseHTTPRequestHandler.headers > documentation mentions about parse_headers function, the function itself is > not documented. Not entirely sure what I

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

2015-02-20 Thread Demian Brecht
Changes by Demian Brecht : Added file: http://bugs.python.org/file38190/issue22928_3.patch ___ Python tracker <http://bugs.python.org/issue22928> ___ ___ Python-bug

[issue21793] httplib client/server status refactor

2015-02-20 Thread Demian Brecht
Demian Brecht added the comment: The updated patch addresses comments which I’d somehow missed previously, but keeps the log fix to the __str__ implementation of HTTPStatus (using int.__str__ rather than format()). > Does not changing __str__ to decimal representation (and in this c

[issue23476] SSL cert verify fail for "www.verisign.com"

2015-02-20 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue23476> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21793] httplib client/server status refactor

2015-02-20 Thread Demian Brecht
Demian Brecht added the comment: > On Feb 20, 2015, at 2:50 PM, Serhiy Storchaka wrote: > > if isinstance(code, HTTPStatus): >code = '%d' % code That’s what I’m intending on doing. It’s definitely not as contained as changing the __str__ implementation of HT

[issue21793] httplib client/server status refactor

2015-02-20 Thread Demian Brecht
Demian Brecht added the comment: Latest patch should address all comments. It also fixes the same issue in error logging which wasn’t previously accounted for. The test file has also been updated with using HTTPStatus where possible rather than hard coded ints. This is consistent with other

[issue21793] httplib client/server status refactor

2015-02-21 Thread Demian Brecht
Demian Brecht added the comment: Well, I’m not entirely sure how I came to the conclusion that errors were a problem (other than not spending enough time walking through it) and of course you’re right about the coercion handling it just fine. I’ve removed the explicit conversion in the code

[issue24363] httplib fails to handle semivalid HTTP headers

2015-06-02 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue24363> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23377] HTTPResponse may drop buffer holding next response

2015-06-07 Thread Demian Brecht
Demian Brecht added the comment: Actually had a few free minutes so stuck a couple minor comments in Rietveld. Will have another go as soon as possible. -- ___ Python tracker <http://bugs.python.org/issue23

[issue24177] Add https?_proxy support to http.client

2015-10-08 Thread Demian Brecht
Demian Brecht added the comment: Yeah, agreed that it should be opt-in, at least until a major release. I've run into a couple cases where higher level libraries use http.client (or httplib) directly, but don't expose the client directly (not that they should anyways). Because of t

[issue26380] Add an http method enum

2016-02-17 Thread Demian Brecht
New submission from Demian Brecht: Super minor annoyance that I've had over multiple projects is seeing either hard coded strings being used (which is a bit of a no-no in terms of best practices) or each project defining its own set of constants for http methods. Why not just incl

[issue26380] Add an http method enum

2016-02-17 Thread Demian Brecht
Demian Brecht added the comment: If nobody's opposed to the addition, I'll run through the unit tests and replace the hard coded strings. -- keywords: +patch Added file: http://bugs.python.org/file41947/issue26380.diff ___ Python trac

[issue26380] Add an http method enum

2016-02-18 Thread Demian Brecht
Demian Brecht added the comment: > I don't have a firm opinion at this point -- can you give a few examples of > how this will help in code? It'll help solely with consistency across projects. Generally, using constants are generally favored over using hardcoded values.

[issue26380] Add an http method enum

2016-02-18 Thread Demian Brecht
Demian Brecht added the comment: > I can see the advantage of using an enum over a plain string. But you only > get an error at run time, not compile time, if you misspell it. Sure, but at least you're giving static analysis utilities the chance to catch it up front. > And the

[issue26380] Add an http method enum

2016-02-18 Thread Demian Brecht
Demian Brecht added the comment: > BTW I think it is actually OPTIONS; see review comment. Well, don't I feel silly. Fixed. -- Added file: http://bugs.python.org/file41962/issue26380_2.patch ___ Python tracker <http://bugs.python.org

[issue26380] Add an http method enum

2016-02-21 Thread Demian Brecht
Demian Brecht added the comment: > To me, your later throw-in comment about static analyzers might be the most > persuasive point you made Well, we're in agreement there :) As I'd mentioned, at best it's a minor annoyance. I'm entirely on the fence about the use of t

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

2015-02-23 Thread Demian Brecht
Demian Brecht added the comment: Pending review of the exceptions from another core dev, the patch looks good to me. Thanks for sticking with it :) -- ___ Python tracker <http://bugs.python.org/issue3

[issue23516] requests: parse_url() mishandles special characters when the URL specifies authentication credentials

2015-02-24 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue23516> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23516] requests: parse_url() mishandles special characters when the URL specifies authentication credentials

2015-02-24 Thread Demian Brecht
Demian Brecht added the comment: > Sounds like this might be in a third-party module +1. urllib3.url_parse doesn't make use of the standard library. > userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) This leads me to believe that using something like t

[issue23516] requests: parse_url() mishandles special characters when the URL specifies authentication credentials

2015-02-24 Thread Demian Brecht
Demian Brecht added the comment: > I can't tell how to label this bug report because I don't know where pip > comes from: as far as I knew this is a bug in something called urllib3, which > seemed to me that was related to Python itself, or maybe in the way pip is > cal

[issue23516] requests: parse_url() mishandles special characters when the URL specifies authentication credentials

2015-02-24 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +Marcus.Smith, dstufft, ncoghlan, pmoore ___ Python tracker <http://bugs.python.org/issue23516> ___ ___ Python-bugs-list mailin

[issue23516] pip: urllib3 does not encode userinfo section of requests: parse_url() mishandles special characters when the URL specifies authentication credentials

2015-02-25 Thread Demian Brecht
Demian Brecht added the comment: FWIW, setting up a local authenticated (ncsa_auth) squid proxy, this breaks using pip 0.6.8: pip --proxy http://special:my?password@localhost:3128 install While the percent-encoded version is successful: pip --proxy http://special:my%3Fpassword@localhost

[issue23516] pip: urllib3 does not encode userinfo section of URL with authentication credentials

2015-02-25 Thread Demian Brecht
Changes by Demian Brecht : -- status: pending -> open title: pip: urllib3 does not encode userinfo section of requests: parse_url() mishandles special characters when the URL specifies authentication credentials -> pip: urllib3 does not encode userinfo section of UR

[issue23254] Document how to close the TCPServer listening socket

2015-02-25 Thread Demian Brecht
Demian Brecht added the comment: Left a couple small nitpicks in Rietveld. Otherwise LGTM. -- nosy: +demian.brecht ___ Python tracker <http://bugs.python.org/issue23

[issue23387] test_urllib2 fails with HTTP Error 502: Bad Gateway

2015-02-25 Thread Demian Brecht
Demian Brecht added the comment: LGTM -- nosy: +demian.brecht stage: patch review -> commit review ___ Python tracker <http://bugs.python.org/issue23387> ___ _

[issue20408] memoryview() constructor documentation error

2015-02-25 Thread Demian Brecht
Demian Brecht added the comment: > Oddly, memoryview accepts keyword arguments (for its one required value), and > the name of the argument is "object", not "obj". Positional parameters can also be treated as named arguments. > I think it's plain daft hav

[issue23526] Silence resource warnings in test_httplib

2015-02-26 Thread Demian Brecht
Changes by Demian Brecht : -- stage: patch review -> commit review ___ Python tracker <http://bugs.python.org/issue23526> ___ ___ Python-bugs-list mai

[issue23526] Silence resource warnings in test_httplib

2015-02-26 Thread Demian Brecht
Demian Brecht added the comment: LGTM -- nosy: +demian.brecht stage: -> patch review type: -> behavior ___ Python tracker <http://bugs.python.org/i

<    1   2   3   4   5   >