Author erezbibi
Recipients erezbibi
Date 2008-05-21.14:43:30
SpamBayes Score 0.0300991
Marked as misclassified No
Message-id <1211381079.94.0.309829253424.issue2935@psf.upfronthosting.co.za>
In-reply-to
Content
Python 2.5 on Windows
rfc822.py line 395
text = name + ": " + value

if 'value' is not a string python will generate an exception. It might
be due to a broken website, but it is not a reason to crash.

I'm using ClientCookie with a Request object (but I don't know the
faulty URL) 

>>> req = urllib2.Request (url)
>>> page = ClientCookie.urlopen (req)
Traceback (most recent call last):
  ...
  File "build\bdist.win32\egg\ClientCookie\_urllib2_support.py", line
824, in urlopen
    return _opener.open(url, data)
  File "C:\Python25\lib\urllib2.py", line 380, in open
    response = meth(req, response)
  File "build\bdist.win32\egg\ClientCookie\_urllib2_support.py", line
412, in http_response
    headers[hdr] = val
  File "C:\Python25\lib\rfc822.py", line 395, in __setitem__
    text = name + ": " + value
TypeError: cannot concatenate 'str' and 'NoneType' objects

A simple fix is to replace 
text = name + ": " + value
with
text = ("%s: %s" % (name, value))
In rfc822.py line 395
History
Date User Action Args
2008-05-21 14:44:53erezbibisetspambayes_score: 0.0300991 -> 0.0300991
recipients: + erezbibi
2008-05-21 14:44:40erezbibisetspambayes_score: 0.0300991 -> 0.0300991
messageid: <1211381079.94.0.309829253424.issue2935@psf.upfronthosting.co.za>
2008-05-21 14:44:37erezbibilinkissue2935 messages
2008-05-21 14:44:34erezbibicreate