cloudera / impyla

Python DB API 2.0 client for Impala and Hive (HiveServer2 protocol)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

:bug: Bug in proxy setting

LucaMingarelli opened this issue · comments

https://github.com/cloudera/impyla/blob/c077bedb142cebdd266148b37f9888d04f730d14/impala/_thrift_api.py#L163C7-L163C38

This seems to be a bug

def basic_proxy_auth_header(proxy):
    if proxy is None or not proxy.username:
      return None
    ap = "%s:%s" % (urllib.parse.unquote(proxy.username),
                    urllib.parse.unquote(proxy.password))
    cr = base64.b64encode(ap).strip()
    return "Basic " + cr

ap here is a string hence base64.b64encode(ap) fails as it expects bytes (e.g. ap.encode()?)

Also not sure about the purpose of the strip on a byte object - it has no effect.