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

Get b64encoding correct for python 2 & 3 #116

Merged
merged 5 commits into from
Feb 1, 2018

Conversation

boorad
Copy link
Contributor

@boorad boorad commented Jan 30, 2018

I was trying 'master' branch and kept getting the following

File "/usr/local/lib/python3.6/site-packages/pydruid/client.py", line 48, in _prepare_url_headers_and_body
    b64encode(bytes('{}:{}'.format(self.username, self.password)))
TypeError: string argument without an encoding

Python3 uses either b'mystring' or bytes('mystring', encoding='myencoding'), so I put together a small patch. Hoping it still works with Python2, but not tested.

@mistercrunch
Copy link
Member

Can you write a unit test? Travis runs against python 2/3. Also looks like Travis wants you to lint a line.

@boorad boorad changed the title python3 bytes() needs an encoding Get b64encoding correct for python 2 & 3 Feb 1, 2018
@mistercrunch
Copy link
Member

fire

@mistercrunch mistercrunch merged commit 4228c2f into druid-io:master Feb 1, 2018
@mistercrunch
Copy link
Member

Oh, I forgot @boorad, would you mind signing a CLA?
http://druid.io/community/cla.html

Thanks!

@boorad
Copy link
Contributor Author

boorad commented Feb 1, 2018

CLA signed. Thanks!

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