diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2008-06-12 18:02:10 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2008-06-12 18:02:10 (GMT) |
commit | 829b99195dade3e835cf50117963cd5b33073717 (patch) | |
tree | 10ba11e19165161e9c672aad7732088c7b1c7288 /Lib/urllib2.py | |
parent | ab82a97b738407269a706996a570bc3ff0af376e (diff) | |
download | cpython-829b99195dade3e835cf50117963cd5b33073717.zip cpython-829b99195dade3e835cf50117963cd5b33073717.tar.gz cpython-829b99195dade3e835cf50117963cd5b33073717.tar.bz2 |
Fixed test_urllib2 by coercing Message object to str
before passing it to io.StringIO.write().
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r-- | Lib/urllib2.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 575bee8..4bcd397 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -1295,7 +1295,7 @@ class FTPHandler(BaseHandler): if retrlen is not None and retrlen >= 0: headers += "Content-length: %d\n" % retrlen headers = email.message_from_string(headers) - sf = StringIO(headers) + sf = StringIO(str(headers)) return addinfourl(fp, headers, req.get_full_url()) except ftplib.all_errors as msg: raise URLError('ftp error: %s' % msg).with_traceback(sys.exc_info()[2]) |