mullender / python-ntlm

Automatically exported from code.google.com/p/python-ntlm
90 stars 42 forks source link

Fix for Python3 #61

Open stamparm opened 4 years ago

stamparm commented 4 years ago

create_NTLM_AUTHENTICATE_MESSAGE and create_NTLM_NEGOTIATE_MESSAGE return already "decoded" str value, while this same double-decode() attempt results with AttributeError: 'str' object has no attribute 'decode' in Python3

cnotin commented 4 years ago

I confirm it's necessary!

cnotin commented 4 years ago

FYI this was introduced by 5c8ccbdf49b083311a4ea07c0a8b200724110a59 Which was because:

The ntml.create_ calls return a byte string

But this isn't what I observe in debugger, due to: https://github.com/mullender/python-ntlm/blob/14e2243e05c8b671c6eae570d670672c9613e563/python30/ntlm/ntlm.py#L219 https://github.com/mullender/python-ntlm/blob/14e2243e05c8b671c6eae570d670672c9613e563/python30/ntlm/ntlm.py#L337