Gregory P. Smith added the comment:
I applied the same _srcfile setting cleanup to 2.7 as we ran into this at work
with an embedded python stdlib. __file__ was set to something by the embedded
importer, but to something different than the path seen on the actual code
objects which appear to
Roundup Robot added the comment:
New changeset da971f467f6e by Gregory P. Smith in branch '2.7':
Issue #21709: Fix the logging module to not depend upon __file__ being set
https://hg.python.org/cpython/rev/da971f467f6e
New changeset bdb219a0219c by Gregory P. Smith in branch '2.7':
Issue21709:
Vinay Sajip added the comment:
Isn't __code__ implementation-specific?
Further data point: the contents of __code__ might be implementation-specific
(as there are no other Python 3 implementations), but the 2.x equivalent,
func_code, is to be found in CPython, Jython, IronPython and PyPy,
Eric Snow added the comment:
addLevelName.__code__.co_filename
Isn't __code__ implementation-specific?
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21709
___
Vinay Sajip added the comment:
Isn't __code__ implementation-specific?
It is, but ISTM it's worth getting a resolution for #21736 before another patch
for this issue is developed.
--
___
Python tracker rep...@bugs.python.org
Marc-Andre Lemburg added the comment:
While the current patch does not resolve the issue, I'm leaving the issue
closed and have instead opened a new Issue21736 which tracks the idea to add a
__file__ attribute to frozen modules per default.
--
___
Vinay Sajip added the comment:
While the current patch does not resolve the issue, I'm leaving the issue
closed
That's fine - I will implement the changes we discussed in this issue, even if
it's something of a stop-gap.
--
___
Python tracker
Roundup Robot added the comment:
New changeset bec6f18dd636 by Vinay Sajip in branch '3.4':
Issue #21709: Improved implementation to cover the frozen module case.
http://hg.python.org/cpython/rev/bec6f18dd636
New changeset bd44ad77013a by Vinay Sajip in branch 'default':
Issue #21709: Merged
Roundup Robot added the comment:
New changeset 11a920a26f13 by Vinay Sajip in branch '3.4':
Issue #21709: Remove references to __file__ when part of a frozen application.
http://hg.python.org/cpython/rev/11a920a26f13
New changeset 149cc6364180 by Vinay Sajip in branch 'default':
Closes #21709:
Marc-Andre Lemburg added the comment:
Hi Vinaj,
thanks for the patch, but it doesn't really help outside of py2exe. The
sys.frozen flag is not an official Python API and it's unlikely to become one,
since you can freeze the whole application or just parts of it, which
sys.frozen would not be
Vinay Sajip added the comment:
Could you please use a fix that works for Python tools in general?
I suggested an alternative implementation altogether in Issue #16778, but it
was suggested that we wait for frame annotations. I'm not sure what the
schedule for that is.
The sys.frozen flag
Marc-Andre Lemburg added the comment:
On 11.06.2014 11:25, Vinay Sajip wrote:
Vinay Sajip added the comment:
Could you please use a fix that works for Python tools in general?
I suggested an alternative implementation altogether in Issue #16778, but it
was suggested that we wait for
Vinay Sajip added the comment:
_srcfile is only used to identify the caller's stack frame
Not quite. It's also used to indicate whether findCaller() should be called at
all: setting it to None avoids calling findCaller(), which might be desirable
in some performance-sensitive scenarios.
So
Marc-Andre Lemburg added the comment:
On 11.06.2014 12:32, Vinay Sajip wrote:
Vinay Sajip added the comment:
_srcfile is only used to identify the caller's stack frame
Not quite. It's also used to indicate whether findCaller() should be called
at all: setting it to None avoids calling
Vinay Sajip added the comment:
Please also add some comment explaining why this is done in this way.
Natürlich :-)
it may be worthwhile introducing some generic helper to the stdlib
Wouldn't you have to pass in a function (or code object) from a specific
module, though? It seems more
Marc-Andre Lemburg added the comment:
On 11.06.2014 13:22, Vinay Sajip wrote:
Vinay Sajip added the comment:
Please also add some comment explaining why this is done in this way.
Natürlich :-)
Prima :-)
it may be worthwhile introducing some generic helper to the stdlib
Wouldn't
New submission from Marc-Andre Lemburg:
It is not when freezing the logging package, so any use of the logging package
fails:
import logging
Traceback (most recent call last):
File console, line 1, in module
File pyrun/importlib/_bootstrap.py, line 2237, in _find_and_load
File
Marc-Andre Lemburg added the comment:
The issue is similar to Issue20884.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21709
___
___
Changes by Berker Peksag berker.pek...@gmail.com:
--
nosy: +vinay.sajip
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21709
___
___
19 matches
Mail list logo