Comments (5)
@yan12125 I'd like to try and fix this, but I don't have a good way to install <2.6.5. pyenv only goes down to 2.6.6. If you have suggestions, please let me know!
from cachecontrol.
If you're using Arch Linux, this PKGBUILD should work: https://github.com/yan12125/aur/tree/master/python264.
from cachecontrol.
@ionrock I suspect this is something that was broken in Python versions prior to 2.6.5 as it was fixed and documented by https://bugs.python.org/issue4978. The release notes for 2.6.5 document as that being fixed in 2.6.5rc1. Further versions 2.6.6 through 2.6.9 all contain various very important security fixes. I think you can support Python 2.6 for versions of 2.6 that aren't terribly broken and insecure. You might just want to say that the only version of 2.6 you want to support is 2.6.9 (or 2.6.6, 2.6.7, and 2.6.9) and that would be completely valid.
from cachecontrol.
@sigmavirus24 Ah hah! Thanks!
So, I'm happy to support 2.6 versions supported by pyenv b/c I can test those, which means >=2.6.6.
@yan12125 I'm going to go ahead and close this out. That said, if you find a fix and can submit a patch, I'm happy to review it.
from cachecontrol.
@ionrock the fix would be to take that dictionary stored in cached["repository"]
and do something like:
if (2, 6, 0) <= sys.version_info < (2, 6, 5):
kwargs = dict((k.encode('utf-8'), v) for (k, v) in cached["response"].items())
else:
kwargs = cached["response"]
And then splat the kwargs
but that's quite a horrible hack to support (and facilitate) usage of versions of Python that are:
- no longer receiving security fixes
- terribly insecure and susceptible to multiple attacks
- no longer something you can easily proactively test with
While that fix is easy enough, I don't think it's a net benefit to a great deal of people.
For code golf purposes you could also do
kwargs = cached["response"]
if (2, 6, 0) <= sys.version_info < (2, 6, 5):
kwargs = dict((k.encode('utf-8'), v) for (k, v) in kwargs.items())
from cachecontrol.
Related Issues (20)
- Release 0.12.12 breaks code that attempts to `from tests.[...] import [...]` HOT 1
- The 0.12.12 release changes the interface for dependent projects in a patch release; can it be made 0.13 instead? HOT 5
- New release with SeparateBody cache fixes? HOT 3
- cachecontrol uses the deprecated utcnow method HOT 1
- cachecontrol is incompatible with Requests 2.30.0 HOT 34
- serialize.py function fails with HTTPResonse has no attribute "strict" HOT 6
- urllib3 2.0: Double reading causes IncompleteRead error
- test_not_modified_releases_connection fails with requests 2.29.0 HOT 1
- 0.12.12: pytest is failing in `tests/test_etag.py::TestReleaseConnection::test_not_modified_releases_connection` unit HOT 2
- 0.12.12: tests/ content is installed HOT 1
- Re-homing + new maintainers HOT 39
- SeparateBodyFileCache does not close the file HOT 2
- Trusted publishing to PyPI HOT 6
- RFC: Remove `serialize._loads_v1` and `_loads_v2` HOT 4
- Dependency change in patch version `0.12.13` broke some projects HOT 6
- The new SeparateBodyFileCache design makes updates/reads non-atomic HOT 4
- If a process crashes half-way through writing a cache entry to a file cache, it will get corrupted HOT 2
- download of partial content is defeated by cachecontrol HOT 3
- 24 tests fail HOT 4
- Race condition in FileCache that can result in empty body 200 response HOT 1
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 cachecontrol.