summaryrefslogtreecommitdiffstats
path: root/Python/fileutils.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-12-22 09:03:38 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-12-22 09:03:38 (GMT)
commit0e576f1f50df1201c56bff7573ab8576e8ab2041 (patch)
treee6934d5a26fc1b6604b79046877b788cd75b22f4 /Python/fileutils.c
parent5ad1af076c3e2b888c8b9401efe1201738e9962c (diff)
downloadcpython-0e576f1f50df1201c56bff7573ab8576e8ab2041.zip
cpython-0e576f1f50df1201c56bff7573ab8576e8ab2041.tar.gz
cpython-0e576f1f50df1201c56bff7573ab8576e8ab2041.tar.bz2
Issue #13626: Add support for SSL Diffie-Hellman key exchange, through the
SSLContext.load_dh_params() method and the ssl.OP_SINGLE_DH_USE option.
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r--Python/fileutils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 1e71431..8993c8c 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -310,6 +310,12 @@ _Py_fopen(PyObject *path, const char *mode)
wchar_t wmode[10];
int usize;
+ if (!PyUnicode_Check(path)) {
+ PyErr_Format(PyExc_TypeError,
+ "str file path expected under Windows, got %R",
+ Py_TYPE(path));
+ return NULL;
+ }
wpath = PyUnicode_AsUnicode(path);
if (wpath == NULL)
return NULL;