Issue1760
Created on 2011-06-15.10:52:41 by yoav.aner, last changed 2015-02-11.22:09:24 by zyasoft.
msg6552 (view) |
Author: Yoav Aner (yoav.aner) |
Date: 2011-06-15.10:52:41 |
|
(copied from jython-dev mailing list, sorry if this is not the proper report format)
Hello,
First post to this list, so please excuse any mistakes or lack of knowledge.
I'm pretty new to jython (and perhaps not fully understand the relationship
with python etc).
One relatively small issue we've came up with is using the logging library.
Things are working fine, but when trying to add the method + line number of
the calling function to the log formatter
(e.g. %(filename)s:%(funcName)s(%(lineno)d ) then we always seemed to get
the line number of __init__.py of the logger itself...
Upon further investigation, it turned out it happens because __init__.py
only looks at .pyc and .pyo files, and ignores $py.class files. Specifically
these lines of code:
if hasattr(sys, 'frozen'): #support for py2exe
_srcfile = "logging%s__init__%s" % (os.sep, __file__[-4:])
elif string.lower(__file__[-4:]) in ['.pyc', '.pyo']:
_srcfile = __file__[:-4] + '.py'
else:
_srcfile = __file__
_srcfile = os.path.normcase(_srcfile)
If another condition is added, e.g.
elif __file__.endswith('$py.class'):
_srcfile = __file__[:-9] + '.py'
then it fixes the problem. Not sure if this needs to be reported upstream to
python or to the jython dev... Again apologies if this is the wrong place to
report this.
Cheers
Yoav
|
msg7737 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2013-02-25.18:34:01 |
|
This looks like a simple fix, setting to high to get my attention.
|
msg9043 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-09-26.05:37:51 |
|
Target beta 4 for 2.7, looks like an obvious fix in reviewing code
|
msg9390 (view) |
Author: Jim Baker (zyasoft) |
Date: 2015-01-14.17:24:20 |
|
Time to get this fix addressed!
|
msg9482 (view) |
Author: Jim Baker (zyasoft) |
Date: 2015-02-03.01:57:38 |
|
Fixed as of https://hg.python.org/jython/rev/d5fdbc0a5b11
|
|
Date |
User |
Action |
Args |
2015-02-11 22:09:24 | zyasoft | set | status: pending -> closed |
2015-02-03 01:57:39 | zyasoft | set | status: open -> pending resolution: remind -> fixed messages:
+ msg9482 title: logging library issue + monkey patch fix -> logging module does not properly set up log record attribute for filename |
2015-01-14 17:24:20 | zyasoft | set | messages:
+ msg9390 |
2015-01-07 06:33:20 | zyasoft | set | assignee: nobody -> zyasoft |
2014-09-26 05:37:51 | zyasoft | set | assignee: fwierzbicki -> nobody messages:
+ msg9043 nosy:
+ zyasoft, nobody versions:
+ Jython 2.7, - Jython 2.5 |
2014-05-22 00:29:18 | zyasoft | set | resolution: remind |
2013-02-25 18:34:01 | fwierzbicki | set | priority: high assignee: fwierzbicki versions:
+ Jython 2.5, - 2.5.1 messages:
+ msg7737 nosy:
+ fwierzbicki |
2011-06-15 10:52:41 | yoav.aner | create | |
|