Skip to content

Conversation

aausch
Copy link
Contributor

@aausch aausch commented Jul 24, 2017

I believe this fixes #75

Note that pool.py has not been necessary since urllib3==1.6 (and minimum is now 1.12, much higher than that) --> see urllib3/urllib3@9570cd2

aausch added 2 commits July 24, 2017 14:44
I believe this fixes jazzband#75
@coveralls
Copy link

coveralls commented Jul 24, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 421a2ff on aausch:master into 4da98bd on TracyWebTech:master.

@coveralls
Copy link

coveralls commented Jul 24, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling a4e5562 on aausch:master into 4da98bd on TracyWebTech:master.

@coveralls
Copy link

coveralls commented Aug 11, 2017

Coverage Status

Coverage decreased (-0.3%) to 99.73% when pulling c28b68e on aausch:master into 4da98bd on TracyWebTech:master.

@coveralls
Copy link

coveralls commented Aug 11, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling e5f4438 on aausch:master into 4da98bd on TracyWebTech:master.

@coveralls
Copy link

coveralls commented Aug 11, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 830c41d on aausch:master into 4da98bd on TracyWebTech:master.

@aausch
Copy link
Contributor Author

aausch commented Aug 11, 2017

Note that pool.py has not been necessary since urllib3==1.6 (and minimum is now 1.12, much higher than that) --> see urllib3/urllib3@9570cd2

@aausch aausch force-pushed the master branch 2 times, most recently from cd7e2ce to c89882f Compare August 11, 2017 18:41
@coveralls
Copy link

coveralls commented Aug 11, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling c89882f on aausch:master into 4da98bd on TracyWebTech:master.

@coveralls
Copy link

coveralls commented Aug 11, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling c89882f on aausch:master into 4da98bd on TracyWebTech:master.

@coveralls
Copy link

coveralls commented Aug 11, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling bee8fee on aausch:master into 4da98bd on TracyWebTech:master.

@aausch
Copy link
Contributor Author

aausch commented Aug 31, 2017

@seocam mind taking a look/merging?

@seocam
Copy link
Contributor

seocam commented Sep 2, 2017

Sorry @aausch I'm gonna work on that next week!

mosasiru added a commit to mosasiru/django-revproxy that referenced this pull request Oct 8, 2017
@msfernandes
Copy link

@seocam there is any prevision to review this PR?

msfernandes added a commit to msfernandes/django-revproxy that referenced this pull request Jan 22, 2018
jazzband#77

Signed-off-by: Matheus Fernandes <matheus.souza.fernandes@gmail.com>
@seocam
Copy link
Contributor

seocam commented Jan 22, 2018

Hey @msfernandes. I've just gave you write access to the repo. Feel free to do and/or ask for modifications before merging anything.

@brianmay
Copy link
Collaborator

brianmay commented May 23, 2018

This patch breaks the tests. Yes, I know Travis tests pass, not sure why. Investigating.

@brianmay
Copy link
Collaborator

brianmay commented May 24, 2018

This change also now required:

diff --git a/tests/test_transformer.py b/tests/test_transformer.py
index 3ef0bbc..1db063d 100644
--- a/tests/test_transformer.py
+++ b/tests/test_transformer.py
@@ -110,6 +110,7 @@ class TransformerTest(TestCase):
         test_file = MockFile(FILE_CONTENT, 4)
         mock_file = MagicMock()
         type(mock_file).encoding = PropertyMock(return_value='utf-8')
+        type(mock_file).isclosed = MagicMock(side_effect=test_file.closed)
         type(mock_file).closed = PropertyMock(side_effect=test_file.closed)
         mock_file.read.side_effect = test_file.read
         mock_file.close.side_effect = test_file.close
@@ -137,6 +138,7 @@ class TransformerTest(TestCase):
 
         mock_file = MagicMock()
         type(mock_file).encoding = PropertyMock(return_value='utf-8')
+        type(mock_file).isclosed = MagicMock(side_effect=test_file.closed)
         type(mock_file).closed = PropertyMock(side_effect=test_file.closed)
         mock_file.read.side_effect = test_file.read
         mock_file.close.side_effect = test_file.close

The problem is urllib3/util/response.py function is_fp_closed now checks obj.isclosed before obj.closed and can get confused when it gets a mock object and incorrectly returns True, preventing further reads from the file.

@brianmay brianmay mentioned this pull request May 24, 2018
@brianmay
Copy link
Collaborator

Fixed in #88.

@brianmay brianmay closed this May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade urllib3 dependency
6 participants