Creating logs with Python

2023-02-22 Thread Bibi
Hello
I want to store and make available as part of my project, logs, for access to 
data. Do you have any proposals?
Kind regards
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue2935] rfc822.py line 395 strings connection

2008-05-21 Thread Erez Bibi

New submission from Erez Bibi [EMAIL PROTECTED]:

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

--
components: Library (Lib)
files: rfc822.py
messages: 67157
nosy: erezbibi
severity: normal
status: open
title: rfc822.py line 395 strings connection
type: crash
versions: Python 2.5
Added file: http://bugs.python.org/file10391/rfc822.py

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2935
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com