Git Product home page Git Product logo

Comments (6)

BlackVoid avatar BlackVoid commented on August 23, 2024 1

You need to make sure the string you send to the sign method is a bytes array and you get a byte-array back.

Try this:

from itsdangerous import Signer
s = Signer('AAAAAAAAAAAAAAAAAAAA')
s.sign('[email protected]'.encode()).decode()
$ python
Python 3.6.3 (default, Oct  9 2017, 12:11:29) 
[GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from itsdangerous import Signer
>>> s = Signer('AAAAAAAAAAAAAAAAAAAA')
>>> s.sign('[email protected]'.encode()).decode()
'[email protected]'

from itsdangerous.

ColdHeat avatar ColdHeat commented on August 23, 2024

Seems like this is fixed in the repo but not on the itsdangerous version in PyPI. Any way we can get a new version or is there a workaround?

from itsdangerous.

ColdHeat avatar ColdHeat commented on August 23, 2024

Seems like the TimedSerializer does not suffer from this issue so I suppose that is the workaround.

from itsdangerous.

FaiChou avatar FaiChou commented on August 23, 2024
➜  ~ pip3 list | grep danger -i
itsdangerous (0.24)
➜  ~ pip3 install -U itsdangerous
Requirement already up-to-date: itsdangerous in /usr/local/lib/python3.6/site-packages
➜  ~

I found the log return value + want_bytes(self.sep) + self.get_signature(value) is not the current version code. My version is 0.24.
So I upgraded, pip3 install -U itsdangerous, but failed with ** already up-to-date**.

Pretty bad. Go to sleep.

from itsdangerous.

RyanSquared avatar RyanSquared commented on August 23, 2024

@BlackVoid interestingly though, it says "must be str" rather than "must be bytes" ?

from itsdangerous.

davidism avatar davidism commented on August 23, 2024

This will be fixed in the next release.

from itsdangerous.

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.