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 vstinner
Recipients ezio.melotti, michael.foord, serhiy.storchaka, vstinner
Date 2017-10-03.14:31:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507041092.74.0.213398074469.issue31676@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is that imp.load_source() modifies __file__ of the __main__ module.

Example of a file x.py:
---
import imp
import sys
print(sys.modules[__name__])
try:
    imp.load_source(__name__, __file__ + "\0")
except:
    pass
print(sys.modules[__name__])
---

Output:
---
<module '__main__' from 'x.py'>
<module '__main__' from 'x.py\x00'>
---
History
Date User Action Args
2017-10-03 14:31:32vstinnersetrecipients: + vstinner, ezio.melotti, michael.foord, serhiy.storchaka
2017-10-03 14:31:32vstinnersetmessageid: <1507041092.74.0.213398074469.issue31676@psf.upfronthosting.co.za>
2017-10-03 14:31:32vstinnerlinkissue31676 messages
2017-10-03 14:31:32vstinnercreate