druid-io / pydruid

A Python connector for Druid
Other
506 stars 194 forks source link

Get b64encoding correct for python 2 & 3 #116

Closed boorad closed 6 years ago

boorad commented 6 years ago

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 commented 6 years ago

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

mistercrunch commented 6 years ago

fire

mistercrunch commented 6 years ago

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

Thanks!

boorad commented 6 years ago

CLA signed. Thanks!