| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Add tox rule to prevent regressions.
|
|
|
|
|
|
|
| |
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 /
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
test/test_util.py
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- 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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
This round-trips with parse_url (or at least equivalently by the RFC).
|
|
|
|
|
|
| |
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.
|
|
|