Skip to content

Conversation

@abelhOrihuela
Copy link

No description provided.

import time
import uuid
import jwt
import urllib
Copy link

@ianlintner-wf ianlintner-wf Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For user examples it's always tricky just providing version changes... def not saying this is the RIGHT way just a couple other options.

Option 1:

import sys
if sys.version_info.major > 2:  # Python 3 or later
    from urllib.parse import quote
else:  # Python 2
    from urllib import quote

Option 2:

use pip install six
since the code already has pip dependency for jwt

Suggested change
import urllib
from six.moves.urllib.parse import quote

#Then change line 39 to

quote(return_to)

If not I would make the python3 version the default.

Comment on lines +38 to +39
# sso_url += "&return_to=" + urllib.parse.quote(return_to)
sso_url += "&return_to=" + urllib.quote(return_to)
Copy link

@ianlintner-wf ianlintner-wf Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In tandem with above addition of import

Suggested change
# sso_url += "&return_to=" + urllib.parse.quote(return_to)
sso_url += "&return_to=" + urllib.quote(return_to)
sso_url += "&return_to=" + quote(return_to)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants