Message28237
| Author |
michaeltsai |
| Recipients |
| Date |
2006年04月21日.19:04:20 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Logged In: YES
user_id=817528
I'm running on Mac OS X 10.4.6.
Here's a simple script:
"""#!/usr/local/bin/python2.4
import logging
logging.basicConfig(format=u"%(filename)s:%(lineno)d %(message)s")
log = logging.getLogger("test")
log.error(u"this is an error")
"""
Unfortunately, it doesn't reliably fail; most of the time it works. I haven't
figured out how to trigger it.
It does reliably fail when I use a frozen system created with "py2app -A" in
which the Python libraries are symlinked in (rather than in a Zip). Then,
logging._srcfile is "logging/__init__.py", but __file__ is something like "/
System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/
logging/__init__.py" Maybe py2app shouldn't set sys.frozen in this case?
Anyway, I don't think that's the real problem, because I've seen this happen
when not using py2app (but, sorry, I'm not able to reliably duplicate it at this
time).
My patch isn't really the right fix, but I do think it works because, at least with
the current logging module, currentframe() is always called with the same
sequence of frames on the top of the stack. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 14:39:25 | admin | link | issue1470422 messages |
| 2007年08月23日 14:39:25 | admin | create |
|