[issue43299] pyclbr.readmodule_ex traversing "import __main__": dies with ValueError: __main__.__spec__ is None / is not set

Andrei Kulakov report at bugs.python.org
Mon Jul 12 01:22:27 EDT 2021


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Robert: thanks for the response..

I looked a bit more into it and I'm starting to think it's a PyWin issue, not pyclbr.

It seems to me that PyWin is calling pyclbr readmodule_ex with module='__main__', and pyclbr is supposed to find it on the filesystem. The problem is, '__main__' is the special name for current script or interactive session. It doesn't give pyclbr any info on where the script might be, if it exists (maybe it's pywin's interactive window?).

So, unless someone more familiar with pyclbr steps in and gives us a bit more insight, I think the best course may be to report this to PyWin. They might also know more about pyclbr, perhaps they've run into similar issues with it before!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43299>
_______________________________________


More information about the Python-bugs-list mailing list