Fixed test_urllib2 by coercing Message object to str

before passing it to io.StringIO.write().
This commit is contained in:
Alexandre Vassalotti 2008-06-12 18:02:10 +00:00
parent ab82a97b73
commit 829b99195d
1 changed files with 1 additions and 1 deletions

View File

@ -1295,7 +1295,7 @@ def ftp_open(self, req):
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])