[issue5952] AttributeError exception in urllib.urlopen

2009-05-07 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Sorry, we need more information to diagnose the problem.
What did you try? Can you provide a minimal example?

Does this reproduce with newer python versions? 2.4 is quite an old
version and will not be corrected.

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5952
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5952] AttributeError exception in urllib.urlopen

2009-05-07 Thread Sergey Prigogin

Sergey Prigogin sprigo...@google.com added the comment:

The problem is pretty obvious from the code.

URLopener.open_http contains the following code:

if data is not None:
h.send(data)
errcode, errmsg, headers = h.getreply()
fp = h.getfile()
if errcode == 200:
return addinfourl(fp, headers, http: + url)
else:
if data is None:
return self.http_error(url, fp, errcode, errmsg, headers)
else:
return self.http_error(url, fp, errcode, errmsg,
headers, data)

In case of an error h.getfile() may return None. self.http_error (line
322) is called with None fp. http_error calls self.http_error_default
(line 339). FancyURLopener.http_error_default calls addinfourl(fp,
headers, http: + url) (line 579), which expects fp to be not None.

For variety of reasons I cannot run this test case with a newer Python
version.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5952
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5952] AttributeError exception in urllib.urlopen

2009-05-07 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Thanks for the info.
This problem is a duplicate of issue767111, which was corrected two 
years ago.
I suggest you to upgrade to 2.5 at least.

--
resolution:  - out of date
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5952
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5952] AttributeError exception in urllib.urlopen

2009-05-06 Thread Sergey Prigogin

New submission from Sergey Prigogin sprigo...@google.com:

File /usr/grte/v1/piii-linux/lib/python2.4/urllib.py, line 82, in
urlopen
   return opener.open(url)
  File /usr/grte/v1/piii-linux/lib/python2.4/urllib.py, line 190, in open
   return getattr(self, name)(url)
  File /usr/grte/v1/piii-linux/lib/python2.4/urllib.py, line 322, in
open_http
   return self.http_error(url, fp, errcode, errmsg, headers)
  File /usr/grte/v1/piii-linux/lib/python2.4/urllib.py, line 339, in
http_error
   return self.http_error_default(url, fp, errcode, errmsg, headers)
  File /usr/grte/v1/piii-linux/lib/python2.4/urllib.py, line 579, in
http_error_default
   return addinfourl(fp, headers, http: + url)
  File /usr/grte/v1/piii-linux/lib/python2.4/urllib.py, line 871, in
__init__
   addbase.__init__(self, fp)
  File /usr/grte/v1/piii-linux/lib/python2.4/urllib.py, line 818, in
__init__
   self.read = self.fp.read
 AttributeError: 'NoneType' object has no attribute 'read'

--
components: Library (Lib)
messages: 87356
nosy: sprigogin
severity: normal
status: open
title: AttributeError exception in urllib.urlopen
type: crash
versions: Python 2.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5952
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com