Bugs item #1365984, was opened at 2005-11-25 02:20
Message generated for change (Settings changed) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1365984&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Warren Butler (grumpymole)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib cannot open data: urls

Initial Comment:
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


----------------------------------------------------------------------

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-11-26 17:52

Message:
Logged In: YES 
user_id=1188172

Fixed in revision 41548 and 41549 (2.4).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1365984&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to