diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-12-22 10:03:38 +0100 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-12-22 10:03:38 +0100 |
commit | 5b02c29edfe71ff031b4bfa5e07063018d552f11 (patch) | |
tree | 87eb6069a1f49b9ccfdf892ae64069b6ba6a653f /Python/fileutils.c | |
parent | 60a12130ca1f1558359b360a3cf5296bed281f04 (diff) | |
download | cpython-5b02c29edfe71ff031b4bfa5e07063018d552f11.tar.gz |
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.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c index 1e71431c00..8993c8c497 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; |