diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-06-25 14:56:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 14:56:31 (GMT) |
commit | 700cfa8c90a90016638bac13c4efd03786b2b2a0 (patch) | |
tree | 62994f7b8d6fccd910d5f65bd6cd49a4f72bf8ae /Modules | |
parent | 8ea6353f60625c96ce96588c70ff24a77f8c71f9 (diff) | |
download | cpython-700cfa8c90a90016638bac13c4efd03786b2b2a0.zip cpython-700cfa8c90a90016638bac13c4efd03786b2b2a0.tar.gz cpython-700cfa8c90a90016638bac13c4efd03786b2b2a0.tar.bz2 |
bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_testcapimodule.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 808483e..adc5877 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4235,15 +4235,15 @@ static PyObject* pymarshal_write_long_to_file(PyObject* self, PyObject *args) { long value; - char *filename; + PyObject *filename; int version; FILE *fp; - if (!PyArg_ParseTuple(args, "lsi:pymarshal_write_long_to_file", + if (!PyArg_ParseTuple(args, "lOi:pymarshal_write_long_to_file", &value, &filename, &version)) return NULL; - fp = fopen(filename, "wb"); + fp = _Py_fopen_obj(filename, "wb"); if (fp == NULL) { PyErr_SetFromErrno(PyExc_OSError); return NULL; @@ -4261,15 +4261,15 @@ static PyObject* pymarshal_write_object_to_file(PyObject* self, PyObject *args) { PyObject *obj; - char *filename; + PyObject *filename; int version; FILE *fp; - if (!PyArg_ParseTuple(args, "Osi:pymarshal_write_object_to_file", + if (!PyArg_ParseTuple(args, "OOi:pymarshal_write_object_to_file", &obj, &filename, &version)) return NULL; - fp = fopen(filename, "wb"); + fp = _Py_fopen_obj(filename, "wb"); if (fp == NULL) { PyErr_SetFromErrno(PyExc_OSError); return NULL; @@ -4288,13 +4288,13 @@ pymarshal_read_short_from_file(PyObject* self, PyObject *args) { int value; long pos; - char *filename; + PyObject *filename; FILE *fp; - if (!PyArg_ParseTuple(args, "s:pymarshal_read_short_from_file", &filename)) + if (!PyArg_ParseTuple(args, "O:pymarshal_read_short_from_file", &filename)) return NULL; - fp = fopen(filename, "rb"); + fp = _Py_fopen_obj(filename, "rb"); if (fp == NULL) { PyErr_SetFromErrno(PyExc_OSError); return NULL; @@ -4313,13 +4313,13 @@ static PyObject* pymarshal_read_long_from_file(PyObject* self, PyObject *args) { long value, pos; - char *filename; + PyObject *filename; FILE *fp; - if (!PyArg_ParseTuple(args, "s:pymarshal_read_long_from_file", &filename)) + if (!PyArg_ParseTuple(args, "O:pymarshal_read_long_from_file", &filename)) return NULL; - fp = fopen(filename, "rb"); + fp = _Py_fopen_obj(filename, "rb"); if (fp == NULL) { PyErr_SetFromErrno(PyExc_OSError); return NULL; @@ -4339,13 +4339,13 @@ pymarshal_read_last_object_from_file(PyObject* self, PyObject *args) { PyObject *obj; long pos; - char *filename; + PyObject *filename; FILE *fp; - if (!PyArg_ParseTuple(args, "s:pymarshal_read_last_object_from_file", &filename)) + if (!PyArg_ParseTuple(args, "O:pymarshal_read_last_object_from_file", &filename)) return NULL; - fp = fopen(filename, "rb"); + fp = _Py_fopen_obj(filename, "rb"); if (fp == NULL) { PyErr_SetFromErrno(PyExc_OSError); return NULL; @@ -4363,13 +4363,13 @@ pymarshal_read_object_from_file(PyObject* self, PyObject *args) { PyObject *obj; long pos; - char *filename; + PyObject *filename; FILE *fp; - if (!PyArg_ParseTuple(args, "s:pymarshal_read_object_from_file", &filename)) + if (!PyArg_ParseTuple(args, "O:pymarshal_read_object_from_file", &filename)) return NULL; - fp = fopen(filename, "rb"); + fp = _Py_fopen_obj(filename, "rb"); if (fp == NULL) { PyErr_SetFromErrno(PyExc_OSError); return NULL; |