summaryrefslogtreecommitdiff
path: root/urllib3/util/url.py
Commit message (Collapse)AuthorAgeFilesLines
* Move urllib3 to src/urllib3Quentin Pradet2018-07-031-230/+0
| | | | | | | | | When tests are outside the main package, tox recommends putting the main package under an 'src' directory to ensure that the installed package is tested, not the source[0] . This layout has other benefits, too. [1] [0]: https://docs.pytest.org/en/latest/goodpractices.html [1]: https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure
* only normalize http(s) urlsNate Prewitt2017-02-121-1/+5
|
* parse_url: Disallow non-integer digits explicitly in port numbersVille Skyttä2016-09-291-2/+6
|
* use dunder slots for Url class slots variableKale Franz2016-07-261-1/+1
|
* Normalize the scheme and host in the URL parserJeremy Cline2016-07-011-1/+6
| | | | | | | | | | According to RFC 3986, the scheme and the host portion of the authority in a URI are case-insensitive. ``urllib3`` uses the scheme in particular as a key for various dictionaries, and oddly-cased schemes can break this. This patch modifies the Url class to normalize both the scheme and host. fixes #833
* Adding all reference docsJon Wayne Parrott2016-06-281-1/+1
|
* Add absolute_import feature from the futureIan Cordasco2015-11-051-0/+1
| | | | | | | | | | This should prevent local files or modules from shadowing standard library modules and will provide an all around better experience. This does not, however, help us in the case where someone uses a library like pies (which installs broken standard library shims for Python 2/ Python 3 compatibility). Related to: https://github.com/kennethreitz/requests/issues/2771
* Fix flake8 violationsJohn Vandenberg2015-11-021-1/+3
| | | | Add tox rule to prevent regressions.
* don't allow path in urls which do not begin with /Thomas Weißschuh2015-04-301-0/+2
| | | | | | | It was possible to create such an object, but it would not serialize -> parse roundtrip. The alternative would be to reject paths without a leading /
* Make str(Url) == Url.urlAaron Meurer2014-09-121-0/+3
|
* Merge branch 'master' into url_unparseAaron Meurer2014-09-121-5/+14
|\ | | | | | | | | Conflicts: test/test_util.py
| * : :: -> ::Andrey Petrov2014-07-011-2/+2
| |
| * Implement retry logicKevin Burke2014-06-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The total number of retries for any type of error will be the maximum of the specified value for the retry type, and the specified total number of retries. So, if you specify total=5 and connect=3, and there are 4 retries, we will not raise a MaxRetryError. Alternatively, if you specify total=3 and connect=5, we will also not raise a MaxRetryError. Please see the tests for a full description of the functionality of the class. - Adds a new successful_retry handler to dummyserver/handlers.py which throws a 418 the first time you call it and a 200 the second time. It uses a class-level defaultdict to store state; I'm not sure how else to implement this. - Adds docs for new features - Splits out util.py into submodules - I need to know what you want to do here because as written it would change from `urllib3.util.Timeout` into `urllib3.util.timeout.Timeout` which is not good. - I believe there are some API changes here. - some subclasses of httplib.HTTPException can actually be raised as connection errors because they imply the request never actually got sent to the server. - urlopen previously would retry on read timeouts, which violated the urlopen contract (as I understood it) of only retrying things that couldn't possibly be side effecting. this code does not retry read timeouts by default. I am also testing this in two new environments - in the office which places my IP on 10.* subnet and I think has weird/different behavior when connecting to TARPIT_HOST than do standard wifi networks, and without an Internet connection, in which case a bunch of tests fail. Also, it's difficult to test some of these exceptional cases because the errors raised rely on the network stack, which (I think) is why the tests are failing on the branch. I'm still looking into it. Either way I am losing some confidence in the connection timeout tests; getting a network to reliably generate ECONNREFUSED, or not generate it and tie up a connection, is tricky, unless we want to go down a path like this: http://bugs.python.org/file26890/test_timeout.patch Ports in find_unused_port from test_support! This will be super useful in the future.
| * Handle blank host with new exception, LocationValueError.Andrey Petrov2014-06-241-0/+4
| |
| * Make util.url flake8 compliantIan Cordasco2014-05-291-3/+7
| |
* | Make something a little clearerAaron Meurer2014-05-291-1/+1
| |
* | Remove unparse_url, in favor of Url.urlAaron Meurer2014-05-281-45/+35
| |
* | Add url attribute to Url, which gives the same thing as unparse_url()Aaron Meurer2014-05-231-0/+6
| |
* | Add unparse_url to urllib3.util.urlAaron Meurer2014-05-231-1/+43
|/ | | | This round-trips with parse_url (or at least equivalently by the RFC).
* Raise LocationParseError if host is NoneKevin Burke2014-03-161-1/+1
| | | | | | Also fixes double-encoding of the error message "Failed to parse:" for LocationParseErrors, and adds tests that parse_url and poolmanager behave in the appropriate ways.
* Refactor urllib3/util.py into submodulesKevin Burke2014-03-101-0/+162