Bugs item #1616422, was opened at 2006-12-15 15:30
Message generated for change (Comment added) made by simleo
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1616422&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.4
>Status: Open
Resolution: Invalid
Priority: 5
Private: No
Submitted By: Tekkaman (simleo)
Assigned to: Vinay Sajip (vsajip)
Summary: Wrong pathname value in logging output

Initial Comment:
When trying to log caller pathname information, instead of the actual caller's 
name I get the full name of the logging module source file:

>>> import logging
>>> logging.basicConfig(format='%(pathname)s')
>>> logging.getLogger('').critical('foo')
/usr/lib/python2.4/logging/__init__.py
>>>

I've been discussing this on comp.lang.python and the suspect arised that this 
has something to do with a symlink in the path leading to the module source 
file (I have a lib -> lib64 symlink on my system). To verify this I copied the 
entire logging directory into my home dir and retried. This is what I got:

>>> import logging
>>> logging.basicConfig(format='%(pathname)s')
>>> logging.getLogger('').critical('foo')
<stdin>
>>>

Additional info:
Python Version: 2.4.3
OS: Gentoo Linux 2.6.17-r8
CPU: AMD Turion(tm) 64 Mobile Technology
sys.path: ['', '/usr/lib/portage/pym', '/usr/lib/python24.zip', 
'/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', 
'/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', 
'/usr/lib64/python2.4/site-packages', 
'/usr/lib64/python2.4/site-packages/Numeric', 
'/usr/lib64/python2.4/site-packages/dbus', 
'/usr/lib64/python2.4/site-packages/gtk-2.0']


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

>Comment By: Tekkaman (simleo)
Date: 2006-12-16 20:03

Message:
Logged In: YES 
user_id=1669352
Originator: YES

I don't get <stdin>, I get "/usr/lib/python2.4/logging/__init__.py". I got
<stdin> (correct behaviour) only after copying the entire logging directory
in the same place where I started the interpreter.

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

Comment By: Vinay Sajip (vsajip)
Date: 2006-12-15 18:20

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

Sorry, why is this wrong? You are making the logging call from an
interactive prompt - so you would expect to get the pathname of <stdin>,
would you not?

I get the same output on Windows where the only logging module is the one
which is part of the standard Python installation.



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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1616422&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to