This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author andrei.avk
Recipients andrei.avk, kxrob
Date 2021-07-06.20:08:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625602124.16.0.257391877427.issue43299@roundup.psfhosted.org>
In-reply-to
Content
Robert: I haven't worked with importlib or pyclbr before, so these may be naive questions, but:

- can your usecase be resolved with a workaround, e.g. setting ModuleSpec manually in / on __main__ module, something like `from importlib._bootstrap import ModuleSpec; __spec__ = ModuleSpec('main',None)

- You mention that this issue may apply to other modules, but the Python docs say __main__ is the only case that may have __spec__=None in some cases (in my testing it indeed have it set to None). Do you have any examples where other modules have __spec__=None?

What's your usecase for examining __main__ with pyclbr? Not trying to sound doubtful, just really curious.

- Re your PR I have a bit of a concern that catching a ValueError silently might mask other types of ValueError, but I haven't looked more closely into that, just want to note it here for the future.

Btw thanks for the reply on PR to my question, it makes sense.
History
Date User Action Args
2021-07-06 20:08:44andrei.avksetrecipients: + andrei.avk, kxrob
2021-07-06 20:08:44andrei.avksetmessageid: <1625602124.16.0.257391877427.issue43299@roundup.psfhosted.org>
2021-07-06 20:08:44andrei.avklinkissue43299 messages
2021-07-06 20:08:43andrei.avkcreate