1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Fix status line parsing

This commit is contained in:
Ian Bicking 2010-07-22 16:55:37 -05:00
parent 92131946f7
commit 8c28d14471

View file

@ -49,7 +49,11 @@ class CachedResponse(object):
if not os.path.exists(filename):
self._cache_url(filename)
fp = open(filename, 'rb')
self.code, self.msg = fp.next().strip().split()
try:
line = fp.next().strip()
self.code, self.msg = line.split(None, 1)
except ValueError:
raise ValueError('Bad field line: %r' % line)
self.code = int(self.code)
for line in fp:
if line == '\n':