Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
184f3d4f
Commit
184f3d4f
authored
Jun 21, 2019
by
Steve Dower
Committed by
Miss Islington (bot)
Jun 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-37364: Use io.open_code() to read .pth files (GH-14299)
https://bugs.python.org/issue37364
parent
f5690925
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
Lib/site.py
Lib/site.py
+2
-1
Misc/NEWS.d/next/Security/2019-06-21-14-42-53.bpo-37364.IIRc2s.rst
....d/next/Security/2019-06-21-14-42-53.bpo-37364.IIRc2s.rst
+1
-0
No files found.
Lib/site.py
View file @
184f3d4f
...
...
@@ -73,6 +73,7 @@ import sys
import
os
import
builtins
import
_sitebuiltins
import
io
# Prefixes for site-packages; add additional prefixes like /usr/local here
PREFIXES
=
[
sys
.
prefix
,
sys
.
exec_prefix
]
...
...
@@ -156,7 +157,7 @@ def addpackage(sitedir, name, known_paths):
reset
=
False
fullname
=
os
.
path
.
join
(
sitedir
,
name
)
try
:
f
=
open
(
fullname
,
"r"
)
f
=
io
.
TextIOWrapper
(
io
.
open_code
(
fullname
)
)
except
OSError
:
return
with
f
:
...
...
Misc/NEWS.d/next/Security/2019-06-21-14-42-53.bpo-37364.IIRc2s.rst
0 → 100644
View file @
184f3d4f
:func:`io.open_code` is now used when reading :file:`.pth` files.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment