Python 2.4.2 cannot open data: urls using open_data().
Appears to be because of importing cStringIO and not
being able to reference fileno.
==============================================
Example fail output:
Traceback (most recent call last):
File "test_open_data.py", line 6, in ?
response = opener.open("data:,A%20brief%20note")
File "/usr/lib/python2.4/urllib.py", line 185, in open
return getattr(self, name)(url)
File "/usr/lib/python2.4/urllib.py", line 559, in
open_data
f.fileno = None # needed for addinfourl
AttributeError: 'cStringIO.StringI' object has no
attribute 'fileno'
==============================================
Example code to generate failure:
import urllib
# data:,A%20brief%20note
opener = urllib.URLopener()
response = opener.open("data:,A%20brief%20note")
==============================================
Note: works in 2.2 version of library.
Problem appears to be here in 2.4:
import mimetools
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
whereas 2.2 reads:
import StringIO, mimetools, time
|