GithubHelp home page GithubHelp logo

Not working with Python < 2.6.5 about cachecontrol HOT 5 CLOSED

psf avatar psf commented on August 18, 2024
Not working with Python < 2.6.5

from cachecontrol.

Comments (5)

ionrock avatar ionrock commented on August 18, 2024

@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.

yan12125 avatar yan12125 commented on August 18, 2024

If you're using Arch Linux, this PKGBUILD should work: https://github.com/yan12125/aur/tree/master/python264.

from cachecontrol.

sigmavirus24 avatar sigmavirus24 commented on August 18, 2024

@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.

ionrock avatar ionrock commented on August 18, 2024

@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.

sigmavirus24 avatar sigmavirus24 commented on August 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.