2011-08-26, 20:29
Is it just me or ATV2 uses python 2.6 and linux uses python 2.7?
Im asking because python 2.6 has a known bug with HTTP authentication.
If you supply the correct user and password, it works with both 2.6 and 2.7 but if you supply a wrong password 2.6 loops asking for a user and password until it crashes. Python 2.7 urllib2 is fine, problem is just with wrong passwords with python urllib2.
heres the bug:
http://bugs.python.org/issue8894
http://bugs.python.org/issue8797
I had to edit the urllib2.py inside the ATV2 to make authentication work, under linux I had to do nothing.. Heres how I fixed it...
replace:
if req.headers.get(self.auth_header, None) == auth:
return None
req.add_header(self.auth_header, auth)
with:
if req.get_header(self.auth_header, None) == auth:
return None
req.add_unredirected_header(self.auth_header, auth)
Hope this helps someone.
Im asking because python 2.6 has a known bug with HTTP authentication.
If you supply the correct user and password, it works with both 2.6 and 2.7 but if you supply a wrong password 2.6 loops asking for a user and password until it crashes. Python 2.7 urllib2 is fine, problem is just with wrong passwords with python urllib2.
heres the bug:
http://bugs.python.org/issue8894
http://bugs.python.org/issue8797
I had to edit the urllib2.py inside the ATV2 to make authentication work, under linux I had to do nothing.. Heres how I fixed it...
replace:
if req.headers.get(self.auth_header, None) == auth:
return None
req.add_header(self.auth_header, auth)
with:
if req.get_header(self.auth_header, None) == auth:
return None
req.add_unredirected_header(self.auth_header, auth)
Hope this helps someone.