Message292325
Apparently, "import site; site.main()" does not seem to work anymore on Python 3.6 and superior.
The reason is a change on the behavior of "os.path.abspath(None)". Before Python 3.6, it used to report an AttributeError which is properly caught inside "site.abs_paths" (see: https://github.com/python/cpython/blob/master/Lib/site.py#L99), making it ignore __main__, one of sys.modules, which has __file__ and __cached__ set to None.
With Python 3.6 and superior, os.path.abspath(None) reports a TypeError, which makes calling "site.main()" raise an exception and stop.
How to reproduce: On python 3.6 or superior, do "import site; site.main()".
Expected behavior: Exception is properly caught and treated inside "site.abs_paths", ignoring modules in which __file__ and/or __cached__ are set to None. |
|
Date |
User |
Action |
Args |
2017-04-26 08:53:33 | anjos | set | recipients:
+ anjos |
2017-04-26 08:53:33 | anjos | set | messageid: <1493196813.64.0.567701209744.issue30167@psf.upfronthosting.co.za> |
2017-04-26 08:53:33 | anjos | link | issue30167 messages |
2017-04-26 08:53:33 | anjos | create | |
|