mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035)
This commit is contained in:
parent
8ea6353f60
commit
700cfa8c90
24 changed files with 110 additions and 77 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue