Comments (10)
Ah, thank you for the excellent bug report and analysis. I believe you're correct.
Is this something you may be interested in fixing and sending a pull request? Otherwise I'll take a look at it in the next week or two.
from urllib3.
I was looking at trying to fix it, but I didn't just want to go in and change stuff while breaking everything. If you're okay reviewing any changes I make to make sure they're not going to mess everything up, I'd be more than happy to give it a shot.
from urllib3.
Absolutely.
Since we suspect the bug is simply the way the queue gets populated, we should be able to start with a simple unit test illustrating the bug. Have a look at some of these for example: https://github.com/shazow/urllib3/blob/master/test/test_connectionpool.py
urllib3 should be very thoroughly tested so hopefully we won't need to worry about breakage too much. :)
from urllib3.
@shazow: Could you run your tests of 358c789? I'm seeing the following failures. Just want to make sure I'm not missing something.
(ve)andi@Apollo:~/Dev/IHR/urllib3$ pip freeze
argparse==1.2.1
coverage==3.5.2
distribute==0.6.24
nose==1.1.2
tornado==2.3
wsgiref==0.1.2
(ve)andi@Apollo:~/Dev/IHR/urllib3$ nosetests
.........................F.F..................................
======================================================================
FAIL: test_cross_host_redirect (test.with_dummyserver.test_poolmanager.TestPoolManager)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/andi/Dev/IHR/urllib3/test/with_dummyserver/test_poolmanager.py", line 36, in test_cross_host_redirect
self.fail("Request succeeded instead of raising an exception like it should.")
AssertionError: Request succeeded instead of raising an exception like it should.
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
root: INFO: 200 GET http://localhost:18081/redirect?target=http%3A%2F%2F127.0.0.1%3A18081%2Fecho%3Fa%3Db (127.0.0.1) 1.38ms
urllib3.connectionpool: DEBUG: "GET http://localhost:18081/redirect?target=http%3A%2F%2F127.0.0.1%3A18081%2Fecho%3Fa%3Db ('HTTP/1.1',)" 200 13
--------------------- >> end captured logging << ---------------------
======================================================================
FAIL: test_redirect (test.with_dummyserver.test_poolmanager.TestPoolManager)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/andi/Dev/IHR/urllib3/test/with_dummyserver/test_poolmanager.py", line 20, in test_redirect
self.assertEqual(r.status, 303)
AssertionError: 200 != 303
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
root: INFO: 200 GET http://localhost:18081/redirect?target=http%3A%2F%2Flocalhost%3A18081%2F (127.0.0.1) 0.76ms
urllib3.connectionpool: DEBUG: "GET http://localhost:18081/redirect?target=http%3A%2F%2Flocalhost%3A18081%2F ('HTTP/1.1',)" 200 13
--------------------- >> end captured logging << ---------------------
Name Stmts Miss Cover Missing
------------------------------------------------------
urllib3 16 0 100%
urllib3._collections 69 0 100%
urllib3.connectionpool 152 7 95% 38, 251, 371-375, 408
urllib3.contrib 0 0 100%
urllib3.exceptions 24 4 83% 43-47
urllib3.filepost 37 0 100%
urllib3.poolmanager 48 3 94% 106-108
urllib3.request 23 0 100%
urllib3.response 80 1 99% 152
urllib3.util 60 0 100%
------------------------------------------------------
TOTAL 509 15 97%
----------------------------------------------------------------------
Ran 62 tests in 0.732s
FAILED (failures=2)
from urllib3.
Hmm, passes on Tornado 2.1.1, fails on Tornado 2.3. Wonder what changed.
from urllib3.
Alrighty, 1bbda4e is linked and contains the fixes. If you could review, I would greatly appreciate it.
from urllib3.
Took a quick glance, looks good! I'll take a more thorough look this weekend and merge it in. Thanks for doing this, @thatguystone. You're welcome to add yourself to the CONTRIBUTORS.txt if you wish. :)
from urllib3.
+1 please merge fix in. Thanks!
from urllib3.
Looks like this has been merged? Hard to tell because it wasn't a real Github pull request. :)
Please reopen if I'm mistaken.
from urllib3.
Just created #86 for this bug. Not sure why I couldn't just make this a pull request :-\
from urllib3.
Related Issues (20)
- imprecise types on `urllib3.Retry.new` / `urllib3.Retry.increment` HOT 1
- Investigate CI failures with Python 3.13.0a5 HOT 2
- "unable to get local issuer certificate", even though cURL works with the same website HOT 3
- Unclosed socket warning after HTTP 407 response from HTTP CONNECT proxy HOT 1
- All Retry backoff_factor to optionally start applying from first retry HOT 4
- Retry backoff_factor offset from second retry incorrectly computed HOT 2
- HTTPConnection.request chunked=False doesn't work properly HOT 8
- Need to exception for "SSLEOFError" on python 3.10, 3.11, 3.12 HOT 3
- After upgrading to 2.2.1: 'HTTPResponse' object has no attribute 'json' HOT 1
- Comment typo settimout settimeout HOT 1
- Dependency management issue HOT 2
- Fix test_redirecting_to_bad_url failure in Requests HOT 12
- NodeJS + pyodide support HOT 1
- Retry.respect_retry_after_header=False is not honored when retry is incremented HOT 1
- Unable to build the doc `Command sphinx-build -b html -W . _build/html failed with exit code 2` HOT 1
- Sunsetting official support for Python 2
- Change log for version 1.26.19
- publish.yml uses two different versions of actions/download-artifact HOT 1
- requests > 2.31 - TypeError: unhashable type: 'list'
- pyproject.toml specifies an illegal value in the "dynamic" field HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urllib3.