New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix AttributeError when the brotli module is installed #1572
Conversation
The recent addition of Brotli support is broken, since it uses an incorrect spelling of `brotli.error`, resulting in: Python 2.7.16 (default, Mar 8 2019, 14:51:39) [GCC 8.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import urllib3.response Traceback (most recent call last): File "<stdin>", line 1, in <module> File "site-packages/urllib3/__init__.py", line 7, in <module> from .connectionpool import ( File "site-packages/urllib3/connectionpool.py", line 37, in <module> from .response import HTTPResponse File "site-packages/urllib3/response.py", line 144, in <module> class HTTPResponse(io.IOBase): File "site-packages/urllib3/response.py", line 344, in HTTPResponse DECODER_ERROR_CLASSES += (brotli.Error,) AttributeError: 'module' object has no attribute 'Error'
Codecov Report
@@ Coverage Diff @@
## master #1572 +/- ##
=======================================
Coverage 99.89% 99.89%
=======================================
Files 22 22
Lines 1873 1873
=======================================
Hits 1871 1871
Misses 2 2
Continue to review full report at Codecov.
|
What version of brotlipy are you using? |
Hm. We are actually using the google's package (which has the same module name): |
That makes sense, we'll have to try testing against that package as well... |
|
Yeah this fix would definitely work, I'm going to merge this and then start preparing some integration tests so that this isn't an issue in the future and also prepare for a 1.25.1 release. Thanks for this! |
we require this fix in our product, unfortunately there is no released version of urllib3 containing this fix. what's the schedule for a release including this? |
This was released in 1.25.1: https://github.com/urllib3/urllib3/blob/master/CHANGES.rst#1251-2019-04-24 |
The recent addition of Brotli support is broken, since it uses an
incorrect spelling of
brotli.error
, resulting in: