summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorOren Milman <orenmn@gmail.com>2017-08-29 17:40:15 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-08-29 17:40:15 (GMT)
commit631fdee6e61b4ba8ce800f827fecdd536bfb04f3 (patch)
tree739bc09153527ad7bde3f5c98587cc13c2353080 /Modules
parent006617ff7d6df3fdedcfe53e94ee2c52cc796437 (diff)
downloadcpython-631fdee6e61b4ba8ce800f827fecdd536bfb04f3.zip
cpython-631fdee6e61b4ba8ce800f827fecdd536bfb04f3.tar.gz
cpython-631fdee6e61b4ba8ce800f827fecdd536bfb04f3.tar.bz2
bpo-31291: Fixed an assertion failure in zipimport.zipimporter.get_data() (#3226)
if pathname.replace('/', '\\') returns non-string.
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 c01ee55..d710360 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -651,7 +651,8 @@ zipimport_zipimporter_get_data_impl(ZipImporter *self, PyObject *path)
Py_ssize_t path_start, path_len, len;
#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