[ python-Bugs-1633605 ] logging module / wrong bytecode?

SourceForge.net noreply at sourceforge.net
Mon Jan 15 13:48:21 CET 2007


Bugs item #1633605, was opened at 2007-01-11 23:06
Message generated for change (Comment added) made by vsajip
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1633605&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
>Status: Closed
>Resolution: Duplicate
Priority: 5
Private: No
Submitted By: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: logging module / wrong bytecode?

Initial Comment:
[forwarded from http://bugs.debian.org/390152]

seen with python2.4 and python2.5 on debian unstable

import logging
logging.basicConfig(level=logging.DEBUG,
                    format='%(pathname)s:%(lineno)d')
logging.info('whoops')

The output when the logging/__init__.pyc file exists is:
logging/__init__.py:1072

and when the __init__.pyc is deleted the output becomes:
tst.py:5


----------------------------------------------------------------------

>Comment By: Vinay Sajip (vsajip)
Date: 2007-01-15 12:48

Message:
Logged In: YES 
user_id=308438
Originator: NO

It's also possible that symlinks mean that the value stored in a .pyc file
are different to the expected values. See bug #1616422 - this appears to be
the same issue.

It's not about the frames - it's about the paths stored in the .pyc files.
If at any time the path (the module's __file__ attribute) in the .pyc file
is different to the actual path to the .py file, you would get this issue.
It's not a logging problem per se - it's that the .py path and the path in
the .pyc files don't match when they should. Logging just happens to be one
of the packages which tries to use the information.

----------------------------------------------------------------------

Comment By: Jim Jewett (jimjjewett)
Date: 2007-01-12 21:22

Message:
Logged In: YES 
user_id=764593
Originator: NO

Does debian by any chance (try to?) store the .py and .pyc files in
different directories?

The second result is correct; the second suggests that it somehow got
confused about which frames to ignore.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1633605&group_id=5470


More information about the Python-bugs-list mailing list