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

Some HTTP requests fail if "uri"type is "bytes" #225

Open
zoosmand opened this issue Jun 7, 2022 · 0 comments
Open

Some HTTP requests fail if "uri"type is "bytes" #225

zoosmand opened this issue Jun 7, 2022 · 0 comments

Comments

@zoosmand
Copy link

zoosmand commented Jun 7, 2022

File "/snap/google-cloud-sdk/current/lib/third_party/httplib2/python3/httplib2/init.py", line 1776, in request
uri = uri.replace(" ", "%20").replace("\r", "%0D").replace("\n", "%0A")
TypeError: a bytes-like object is required, not 'str'

Particularly, "google-cloud-sdk" using your lib, passes bytes in some occurrences.

This could be simply be fixed like this (nearby the line 1533):

if isinstance(uri, bytes):
    uri = uri.decode("utf-8")

just before uri = uri.replace.....

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

No branches or pull requests

1 participant