-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Solve incompatibility errors in _compression.py #6261
Conversation
Increase compatibility across different virtual environments, particularly with Conda, when using brotli.Decompressor()
Is this only required when |
Yes. I don't know why, but when setting up conda environments and installing scrapy and other packages it seems Conda / Mamba only installs brotlipy. |
Maybe we should do something to make Scrapy distinguish the 2, and only enable brotli support when the right one is installed. |
Yeah. |
Note that Scrapy currently does not depend on brotli (or on brotlipy), neither on PyPI nor on Conda, and if something installs brotlipy as opposed to not installing anything it's either "other packages" you mentioned or some other things you do when "setting up". |
I understand. However, in my current conda env I just have a few packages installed, most of them are well-known ones like Scrapy, Selenium, Pandas, Numpy, etc. and somehow, Conda or Mamba installed brotlipy, which throws an AttributeError when running Scrapy. So this simple change solves this issue, adding compatibility with brotlipy and hence with other packages installed using Conda / Mamba as well. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6261 +/- ##
=======================================
Coverage 88.89% 88.90%
=======================================
Files 161 161
Lines 11776 11786 +10
Branches 1913 1913
=======================================
+ Hits 10468 10478 +10
Misses 964 964
Partials 344 344
|
Increase compatibility across different virtual environments, particularly with Conda, when using brotli.Decompressor()