[New-bugs-announce] [issue16301] localhost() and thishost() in urllib/request.py

Senthil Kumaran report at bugs.python.org
Mon Oct 22 17:29:05 CEST 2012


New submission from Senthil Kumaran:

localhost() returns a string and thishost() returns tuple. In urllib/request.py, for file:// protocol, there is a verification to check to if the host is in the localhost and check happens:

socket.gethostbyname(host) in (localhost() + thishost())):

This is clearly wrong for the above mentioned reason. It should be changed to this, wrapping localhost with tuple() or making localhost return a tuple, which will be consistent with thishost

socket.gethostbyname(host) in (tuple(localhost()) + thishost())):

----------
assignee: orsenthil
messages: 173530
nosy: orsenthil
priority: normal
severity: normal
status: open
title: localhost() and thishost() in urllib/request.py
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16301>
_______________________________________


More information about the New-bugs-announce mailing list