diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-06-11 01:21:35 (GMT) |
|---|---|---|
| committer | Ned Deily <nad@python.org> | 2018-06-11 01:21:35 (GMT) |
| commit | ec4343c3b4c0e0a7500122fac616e6488c0ab842 (patch) | |
| tree | 6fd56f9f02e1fd80e5df52d3e1f70ac24399385e /Python/pythonmain.c | |
| parent | 037e9125527d4a55af566f161c96a61b3c3fd998 (diff) | |
| download | cpython-ec4343c3b4c0e0a7500122fac616e6488c0ab842.zip cpython-ec4343c3b4c0e0a7500122fac616e6488c0ab842.tar.gz cpython-ec4343c3b4c0e0a7500122fac616e6488c0ab842.tar.bz2 | |
bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. (GH-6731) (GH-7606)
Before Python 3.6, os.path.abspath(None) used to report an AttributeError which was properly caught inside site.abs_paths, making it ignore __main__, one of sys.modules, which has __file__ and __cached__ set to None. With 3.6, os.path.abspath(None) raises TypeError instead which site.abs_path was not expecting. This resulted in an uncaught exception if a user had PYTHONSTARTUP set and the application called site.main() which a number of third-party programs do.
(cherry picked from commit 2487f30d5529948ace26559e274d7cac6abcd1a8)
Co-authored-by: Steve Weber <steverweber@gmail.com>
Diffstat (limited to 'Python/pythonmain.c')
0 files changed, 0 insertions, 0 deletions
