Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError: 'latin-1' codec can't encode character '\u0335' in position 19: ordinal not in range(256) #6079

Closed
DeloitteYuvarajan opened this issue Mar 7, 2022 · 0 comments

Comments

@DeloitteYuvarajan
Copy link

username = username.encode('latin1')

I got the below error on authenticating a Gmail user in my app, P.S: I have client-id and client-secret stored in a file from GCP project.

File "/venv/lib/python3.9/site-packages/google_auth_oauthlib/flow.py", line 240, in fetch_token return self.oauth2session.fetch_token( File "/venv/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 341, in fetch_token r = self.request( File "/venv/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 521, in request return super(OAuth2Session, self).request( File "/venv/lib/python3.9/site-packages/requests/sessions.py", line 515, in request prep = self.prepare_request(req) File "/venv/lib/python3.9/site-packages/requests/sessions.py", line 443, in prepare_request p.prepare( File "/venv/lib/python3.9/site-packages/requests/models.py", line 322, in prepare self.prepare_auth(auth, url) File "/venv/lib/python3.9/site-packages/requests/models.py", line 558, in prepare_auth r = auth(self) File "/venv/lib/python3.9/site-packages/requests/auth.py", line 96, in __call__ r.headers['Authorization'] = _basic_auth_str(self.username, self.password) File "/venv/lib/python3.9/site-packages/requests/auth.py", line 60, in _basic_auth_str username = username.encode('latin1') UnicodeEncodeError: 'latin-1' codec can't encode character '\u0335' in position 19: ordinal not in range(256)

@psf psf locked and limited conversation to collaborators Mar 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant