summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorSteve Weber <steverweber@gmail.com>2018-06-11 00:49:34 (GMT)
committerNed Deily <nad@python.org>2018-06-11 00:49:34 (GMT)
commit2487f30d5529948ace26559e274d7cac6abcd1a8 (patch)
treefd1d6dda91a2988d54eb0cd89727646280435378 /Misc
parent8398713cea0eb17b013f25f86bef47c7e5e63139 (diff)
downloadcpython-2487f30d5529948ace26559e274d7cac6abcd1a8.zip
cpython-2487f30d5529948ace26559e274d7cac6abcd1a8.tar.gz
cpython-2487f30d5529948ace26559e274d7cac6abcd1a8.tar.bz2
bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. (GH-6731)
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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS.d/next/Library/2018-06-10-19-29-17.bpo-30167.G5EgC5.rst1
2 files changed, 2 insertions, 0 deletions
diff --git a/Misc/ACKS b/Misc/ACKS
index 481385f..96aad50 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1721,6 +1721,7 @@ David Watson
Aaron Watters
Henrik Weber
Leon Weber
+Steve Weber
Corran Webster
Glyn Webster
Phil Webster
diff --git a/Misc/NEWS.d/next/Library/2018-06-10-19-29-17.bpo-30167.G5EgC5.rst b/Misc/NEWS.d/next/Library/2018-06-10-19-29-17.bpo-30167.G5EgC5.rst
new file mode 100644
index 0000000..072a001
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-06-10-19-29-17.bpo-30167.G5EgC5.rst
@@ -0,0 +1 @@
+Prevent site.main() exception if PYTHONSTARTUP is set. Patch by Steve Weber.