lionheart / python-harvest

A Python wrapper for the Harvest time-tracking API.
Apache License 2.0
55 stars 49 forks source link

When using basic auth the authorization header is wrong in Python 3 #33

Closed maksymilian-majer closed 6 years ago

maksymilian-majer commented 6 years ago

The authorization header is set in line 55 like this:

self.__headers['Authorization'] = 'Basic {0}'.format(enc64("{self.email}:{self.password}".format(self=self).encode("utf8")))

This produces a string like: 'Basic b\'some_base_64\''

Instead of: 'Basic some_base_64'

This can be simply fixed by calling .decode() on the Base64 encoded bytes.

dlo commented 6 years ago

Fixed by #34