Marc-Andre Lemburg added the comment: On 12.06.2014 18:35, Barry A. Warsaw wrote: > > I'm -0 on this patch. I can understand that in some sense, frozen modules do > semantically have an associated file, but OTOH, once they're frozen the > connection to their file is broken. Also, I think anything that assumes > __file__ exists is simply broken and should be fixed. There are other cases > than frozen modules where a module would have no reasonable value for > __file__ and thus shouldn't have one.
This one falls into the practicality beats purity category. Of course, the __file__ attribute doesn't always makes sense as file path, but it does serve an information purpose. We're doing this in eGenix PyRun to get 3rd party code working (including parts of the Python stdlib :-)). Not doing so would simply lead to the whole freezing approach pretty much useless, since so much code uses the attribute without checking or providing a fallback solution. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21736> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com