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
ff70fc22
Commit
ff70fc22
authored
Sep 09, 2016
by
Steve Dower
Browse files
Options
Browse Files
Download
Plain Diff
Issue #25758: Prevents zipimport from unnecessarily encoding a filename (patch by Eryk Sun)
parents
13192361
8dcc48ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
11 deletions
+8
-11
Lib/test/test_zipimport.py
Lib/test/test_zipimport.py
+1
-1
Misc/NEWS
Misc/NEWS
+3
-0
Modules/zipimport.c
Modules/zipimport.c
+4
-10
No files found.
Lib/test/test_zipimport.py
View file @
ff70fc22
...
...
@@ -615,7 +615,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
z
.
writestr
(
zinfo
,
test_src
)
z
.
close
()
try
:
zipimport
.
zipimporter
(
filename
)
zipimport
.
zipimporter
(
filename
)
.
load_module
(
TESTMOD
)
finally
:
os
.
remove
(
filename
)
...
...
Misc/NEWS
View file @
ff70fc22
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.6.0 beta 1
Core and Builtins
-----------------
- Issue #25758: Prevents zipimport from unnecessarily encoding a filename
(patch by Eryk Sun)
- Issue #25856: The __module__ attribute of extension classes and functions
now is interned. This leads to more compact pickle data with protocol 4.
...
...
Modules/zipimport.c
View file @
ff70fc22
...
...
@@ -1362,22 +1362,16 @@ normalize_line_endings(PyObject *source)
static
PyObject
*
compile_source
(
PyObject
*
pathname
,
PyObject
*
source
)
{
PyObject
*
code
,
*
fixed_source
,
*
pathbytes
;
pathbytes
=
PyUnicode_EncodeFSDefault
(
pathname
);
if
(
pathbytes
==
NULL
)
return
NULL
;
PyObject
*
code
,
*
fixed_source
;
fixed_source
=
normalize_line_endings
(
source
);
if
(
fixed_source
==
NULL
)
{
Py_DECREF
(
pathbytes
);
return
NULL
;
}
code
=
Py_CompileString
(
PyBytes_AsString
(
fixed_source
),
PyBytes_AsString
(
pathbytes
),
Py_file_input
);
Py_DECREF
(
pathbytes
);
code
=
Py_CompileStringObject
(
PyBytes_AsString
(
fixed_source
),
pathname
,
Py_file_input
,
NULL
,
1
);
Py_DECREF
(
fixed_source
);
return
code
;
}
...
...
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