You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: