summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorOren Milman <orenmn@gmail.com>2017-08-30 11:08:39 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-08-30 11:08:39 (GMT)
commit095a421b1606ee27e00a5d9d253b05a9f0cfadb8 (patch)
tree8c5710eab63528c40b12216317eaa49bd8aa96b2 /Modules
parent2d1653aa43cf02e6b74f9d4f178fac9969a293e2 (diff)
downloadcpython-095a421b1606ee27e00a5d9d253b05a9f0cfadb8.zip
cpython-095a421b1606ee27e00a5d9d253b05a9f0cfadb8.tar.gz
cpython-095a421b1606ee27e00a5d9d253b05a9f0cfadb8.tar.bz2
[3.6] bpo-31291: Fixed an assertion failure in zipimport.zipimporter.get_data() (GH-3226) (#3243)
if pathname.replace('/', '\\') returns non-string. (cherry picked from commit 631fdee6e61b4ba8ce800f827fecdd536bfb04f3)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/zipimport.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index cccc033..5bf31cc 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -580,7 +580,8 @@ zipimporter_get_data(PyObject *obj, PyObject *args)
return NULL;
#ifdef ALTSEP
- path = _PyObject_CallMethodId(path, &PyId_replace, "CC", ALTSEP, SEP);
+ path = _PyObject_CallMethodId((PyObject *)&PyUnicode_Type, &PyId_replace,
+ "OCC", path, ALTSEP, SEP);
if (!path)
return NULL;
#else