summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Include/unicodeobject.h3
-rw-r--r--Modules/_ctypes/_ctypes.c2
-rw-r--r--Modules/_dbmmodule.c2
-rw-r--r--Objects/typeobject.c2
-rw-r--r--Objects/unicodeobject.c7
-rw-r--r--Python/bltinmodule.c2
-rw-r--r--Python/compile.c2
-rw-r--r--Python/getargs.c2
8 files changed, 9 insertions, 13 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 4d2a8e4..6c492d1 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -668,8 +668,7 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString(
- PyObject *unicode,
- const char *errors);
+ PyObject *unicode);
#endif
/* Returns a pointer to the default encoding (UTF-8) of the
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index ff35862..d30018b 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -1826,7 +1826,7 @@ PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
}
if (PyUnicode_Check(proto)) {
- PyObject *v = _PyUnicode_AsDefaultEncodedString(proto, NULL);
+ PyObject *v = _PyUnicode_AsDefaultEncodedString(proto);
if (!v)
goto error;
proto_str = PyBytes_AS_STRING(v);
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index 827acce..69a7112 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -219,7 +219,7 @@ dbm_contains(PyObject *self, PyObject *arg)
return -1;
}
if (PyUnicode_Check(arg)) {
- arg = _PyUnicode_AsDefaultEncodedString(arg, NULL);
+ arg = _PyUnicode_AsDefaultEncodedString(arg);
if (arg == NULL)
return -1;
}
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 500dfc9..fa8d15d 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -4975,7 +4975,7 @@ slot_tp_str(PyObject *self)
res = slot_tp_repr(self);
if (!res)
return NULL;
- ress = _PyUnicode_AsDefaultEncodedString(res, NULL);
+ ress = _PyUnicode_AsDefaultEncodedString(res);
Py_DECREF(res);
return ress;
}
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index cd0fccf..e4539cd 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1806,14 +1806,11 @@ PyUnicode_AsEncodedUnicode(PyObject *unicode,
}
PyObject *
-_PyUnicode_AsDefaultEncodedString(PyObject *unicode,
- const char *errors)
+_PyUnicode_AsDefaultEncodedString(PyObject *unicode)
{
PyObject *v = ((PyUnicodeObject *)unicode)->defenc;
if (v)
return v;
- if (errors != NULL)
- Py_FatalError("non-NULL encoding in _PyUnicode_AsDefaultEncodedString");
v = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode),
PyUnicode_GET_SIZE(unicode),
NULL);
@@ -1959,7 +1956,7 @@ _PyUnicode_AsStringAndSize(PyObject *unicode, Py_ssize_t *psize)
PyErr_BadArgument();
return NULL;
}
- bytes = _PyUnicode_AsDefaultEncodedString(unicode, NULL);
+ bytes = _PyUnicode_AsDefaultEncodedString(unicode);
if (bytes == NULL)
return NULL;
if (psize != NULL)
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index c6bb16c..ca40cb0 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -511,7 +511,7 @@ source_as_string(PyObject *cmd, char *funcname, char *what, PyCompilerFlags *cf)
if (PyUnicode_Check(cmd)) {
cf->cf_flags |= PyCF_IGNORE_COOKIE;
- cmd = _PyUnicode_AsDefaultEncodedString(cmd, NULL);
+ cmd = _PyUnicode_AsDefaultEncodedString(cmd);
if (cmd == NULL)
return NULL;
}
diff --git a/Python/compile.c b/Python/compile.c
index 1d6e38c..53f5a12 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3026,7 +3026,7 @@ expr_constant(struct compiler *c, expr_ty e)
case Name_kind:
/* optimize away names that can't be reassigned */
id = PyBytes_AS_STRING(
- _PyUnicode_AsDefaultEncodedString(e->v.Name.id, NULL));
+ _PyUnicode_AsDefaultEncodedString(e->v.Name.id));
if (strcmp(id, "True") == 0) return 1;
if (strcmp(id, "False") == 0) return 0;
if (strcmp(id, "None") == 0) return 0;
diff --git a/Python/getargs.c b/Python/getargs.c
index 17d5993..e1cef0c 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -551,7 +551,7 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags,
#define UNICODE_DEFAULT_ENCODING(arg) \
- _PyUnicode_AsDefaultEncodedString(arg, NULL)
+ _PyUnicode_AsDefaultEncodedString(arg)
/* Format an error message generated by convertsimple(). */