diff -r a175cc162933 Modules/_codecsmodule.c --- a/Modules/_codecsmodule.c Sat Aug 08 11:20:24 2015 -0400 +++ b/Modules/_codecsmodule.c Sat Aug 08 11:39:32 2015 -0400 @@ -91,22 +91,23 @@ /*[clinic input] _codecs.encode obj: object - encoding: str(c_default="NULL") = sys.getdefaultencoding() + encoding: str(accept={str, NoneType}) = NULL errors: str(c_default="NULL") = "strict" Encodes obj using the codec registered for encoding. -encoding defaults to the default encoding. errors may be given to set a -different error handling scheme. Default is 'strict' meaning that encoding -errors raise a ValueError. Other possible values are 'ignore', 'replace' -and 'backslashreplace' as well as any other name registered with -codecs.register_error that can handle ValueErrors. +encoding defaults to the default encoding (see sys.getdefaultencoding()). + +errors may be given to set a different error handling scheme. Default is +'strict' meaning that encoding errors raise a ValueError. Other possible +values are 'ignore', 'replace' and 'backslashreplace' as well as any other +name registered with codecs.register_error that can handle ValueErrors. [clinic start generated code]*/ static PyObject * _codecs_encode_impl(PyModuleDef *module, PyObject *obj, const char *encoding, const char *errors) -/*[clinic end generated code: output=5c073f62249c8d7c input=2440d769df020a0e]*/ +/*[clinic end generated code: output=5c073f62249c8d7c input=b06ddc7832b3b030]*/ { if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); @@ -118,22 +119,23 @@ /*[clinic input] _codecs.decode obj: object - encoding: str(c_default="NULL") = sys.getdefaultencoding() + encoding: str(accept={str, NoneType}) = NULL errors: str(c_default="NULL") = "strict" Decodes obj using the codec registered for encoding. -encoding defaults to the default encoding. errors may be given to set a -different error handling scheme. Default is 'strict' meaning that encoding -errors raise a ValueError. Other possible values are 'ignore', 'replace' -and 'backslashreplace' as well as any other name registered with -codecs.register_error that can handle ValueErrors. +encoding defaults to the default encoding (see sys.getdefaultencoding()). + +errors may be given to set a different error handling scheme. Default is +'strict' meaning that encoding errors raise a ValueError. Other possible +values are 'ignore', 'replace' and 'backslashreplace' as well as any other +name registered with codecs.register_error that can handle ValueErrors. [clinic start generated code]*/ static PyObject * _codecs_decode_impl(PyModuleDef *module, PyObject *obj, const char *encoding, const char *errors) -/*[clinic end generated code: output=c81cbf6189a7f878 input=a351e5f5baad1544]*/ +/*[clinic end generated code: output=c81cbf6189a7f878 input=af59bf6e965bca8b]*/ { if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); diff -r a175cc162933 Modules/clinic/_codecsmodule.c.h --- a/Modules/clinic/_codecsmodule.c.h Sat Aug 08 11:20:24 2015 -0400 +++ b/Modules/clinic/_codecsmodule.c.h Sat Aug 08 11:39:32 2015 -0400 @@ -42,17 +42,17 @@ } PyDoc_STRVAR(_codecs_encode__doc__, -"encode($module, /, obj, encoding=sys.getdefaultencoding(),\n" -" errors=\'strict\')\n" +"encode($module, /, obj, encoding=None, errors=\'strict\')\n" "--\n" "\n" "Encodes obj using the codec registered for encoding.\n" "\n" -"encoding defaults to the default encoding. errors may be given to set a\n" -"different error handling scheme. Default is \'strict\' meaning that encoding\n" -"errors raise a ValueError. Other possible values are \'ignore\', \'replace\'\n" -"and \'backslashreplace\' as well as any other name registered with\n" -"codecs.register_error that can handle ValueErrors."); +"encoding defaults to the default encoding (see sys.getdefaultencoding()).\n" +"\n" +"errors may be given to set a different error handling scheme. Default is\n" +"\'strict\' meaning that encoding errors raise a ValueError. Other possible\n" +"values are \'ignore\', \'replace\' and \'backslashreplace\' as well as any other\n" +"name registered with codecs.register_error that can handle ValueErrors."); #define _CODECS_ENCODE_METHODDEF \ {"encode", (PyCFunction)_codecs_encode, METH_VARARGS|METH_KEYWORDS, _codecs_encode__doc__}, @@ -70,7 +70,7 @@ const char *encoding = NULL; const char *errors = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|ss:encode", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|zs:encode", _keywords, &obj, &encoding, &errors)) goto exit; return_value = _codecs_encode_impl(module, obj, encoding, errors); @@ -80,17 +80,17 @@ } PyDoc_STRVAR(_codecs_decode__doc__, -"decode($module, /, obj, encoding=sys.getdefaultencoding(),\n" -" errors=\'strict\')\n" +"decode($module, /, obj, encoding=None, errors=\'strict\')\n" "--\n" "\n" "Decodes obj using the codec registered for encoding.\n" "\n" -"encoding defaults to the default encoding. errors may be given to set a\n" -"different error handling scheme. Default is \'strict\' meaning that encoding\n" -"errors raise a ValueError. Other possible values are \'ignore\', \'replace\'\n" -"and \'backslashreplace\' as well as any other name registered with\n" -"codecs.register_error that can handle ValueErrors."); +"encoding defaults to the default encoding (see sys.getdefaultencoding()).\n" +"\n" +"errors may be given to set a different error handling scheme. Default is\n" +"\'strict\' meaning that encoding errors raise a ValueError. Other possible\n" +"values are \'ignore\', \'replace\' and \'backslashreplace\' as well as any other\n" +"name registered with codecs.register_error that can handle ValueErrors."); #define _CODECS_DECODE_METHODDEF \ {"decode", (PyCFunction)_codecs_decode, METH_VARARGS|METH_KEYWORDS, _codecs_decode__doc__}, @@ -108,7 +108,7 @@ const char *encoding = NULL; const char *errors = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|ss:decode", _keywords, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|zs:decode", _keywords, &obj, &encoding, &errors)) goto exit; return_value = _codecs_decode_impl(module, obj, encoding, errors); @@ -1395,4 +1395,4 @@ #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=713a4081788da1bc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d00006e5f3a29a2d input=a9049054013a1b77]*/