[issue21709] logging.__init__ assumes that __file__ is always set

Vinay Sajip report at bugs.python.org
Wed Jun 11 13:22:49 CEST 2014


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 logical to have __file__ set, even for frozen modules (after all, if it's there in a code object's co_filename, is there some reason it shouldn't be exposed as a module attribute? (Even though it isn't at the moment.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21709>
_______________________________________


More information about the Python-bugs-list mailing list