Message303621
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'>
--- |
|
Date |
User |
Action |
Args |
2017-10-03 14:31:32 | vstinner | set | recipients:
+ vstinner, ezio.melotti, michael.foord, serhiy.storchaka |
2017-10-03 14:31:32 | vstinner | set | messageid: <1507041092.74.0.213398074469.issue31676@psf.upfronthosting.co.za> |
2017-10-03 14:31:32 | vstinner | link | issue31676 messages |
2017-10-03 14:31:32 | vstinner | create | |
|