[New-bugs-announce] [issue10077] Python 3.1: site error is not logged

STINNER Victor report at bugs.python.org
Wed Oct 13 00:47:59 CEST 2010

New submission from STINNER Victor <victor.stinner at haypocalc.com>:

If the site module fails, the error is not logged because of a bug in initsite(). The problem is that PyFile_WriteString() does nothing if an error occurred.

 - Edit Lib/site.py to add "raise Exception('xxx')" at the beginning of main()
 - Run ./python
 - (no error is logged)

In verbose mode, only the exception is logged, without the first line:

  'import site' failed; traceback:

Attached patch fixes both issues.


This issue is specific to Python 3.1:
 - Python 2.7 and 3.2 consider site error as a fatal error 
 - Python 2.6 doesn't have the bug because PyFile_WriteString() write the message even if an error occurred

components: Library (Lib)
files: site_error.patch
keywords: patch
messages: 118478
nosy: haypo
priority: normal
severity: normal
status: open
title: Python 3.1: site error is not logged
versions: Python 3.1
Added file: http://bugs.python.org/file19207/site_error.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list