Coder Social home page Coder Social logo

Comments (12)

mark-adams avatar mark-adams commented on May 19, 2024

Which specific version of Python does that happen in?

from pyjwt.

mark-adams avatar mark-adams commented on May 19, 2024

Nevermind, I got it in 2.7.

from pyjwt.

wbolster avatar wbolster commented on May 19, 2024

The source of the problem (for Python 2) is that the unicode_literals future import makes it impossible to use "native strings" in the module, and since "native strings" are used all over the place in Python, this causes all kinds of weird errors.

from pyjwt.

mark-adams avatar mark-adams commented on May 19, 2024

I'm also going to go ahead and mention the article you linked to in #67, since it seems to provide a good discussion on the issue: PythonCharmers/python-future#22

from pyjwt.

jpadilla avatar jpadilla commented on May 19, 2024

Anything happen when we remove unicode_literals?

from pyjwt.

wbolster avatar wbolster commented on May 19, 2024

Don't think so, since the API doesn't have any str/unicode default args or return values, afaics. Perhaps the dict lookups for the algos (that was reworked anyway) needs some special care so that the caller can always specify a native string for those.

from pyjwt.

jpadilla avatar jpadilla commented on May 19, 2024

@wbolster nothing seemed to happen in #75.

from pyjwt.

jpadilla avatar jpadilla commented on May 19, 2024

Closed via 6a0f184

from pyjwt.

wbolster avatar wbolster commented on May 19, 2024

for reference, this was fixed via #76

from pyjwt.

merwok avatar merwok commented on May 19, 2024

For the record, one can use the b'string of bytes' syntax in 2.6+ to have “native strings” in a module with unicode literals enabled.

from pyjwt.

wbolster avatar wbolster commented on May 19, 2024

No, because it would result in bytes on Python 3, and those are not native strings.

"Éric Araujo" [email protected] schreef op 23 maart 2015 20:28:29 CET:

For the record, one can use the b'string of bytes' syntax in 2.6+
to have “native strings” in a module with unicode literals enabled.


Reply to this email directly or view it on GitHub:
#73 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

from pyjwt.

mark-adams avatar mark-adams commented on May 19, 2024

Isn't this resolved already? 😄

from pyjwt.

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.