@@ -24,10 +24,9 @@ static PyObject *
2424codec_known_encoding (PyObject  * Py_UNUSED (module ), PyObject  * args )
2525{
2626    const  char  * encoding ;   // should not be NULL 
27-     if  (!PyArg_ParseTuple (args , "z " , & encoding )) {
27+     if  (!PyArg_ParseTuple (args , "s " , & encoding )) {
2828        return  NULL ;
2929    }
30-     assert (encoding  !=  NULL );
3130    return  PyCodec_KnownEncoding (encoding ) ? Py_True  : Py_False ;
3231}
3332
@@ -39,10 +38,9 @@ codec_encode(PyObject *Py_UNUSED(module), PyObject *args)
3938    PyObject  * input ;
4039    const  char  * encoding ;   // should not be NULL 
4140    const  char  * errors ;     // can be NULL 
42-     if  (!PyArg_ParseTuple (args , "O|zz " , & input , & encoding , & errors )) {
41+     if  (!PyArg_ParseTuple (args , "O|sz " , & input , & encoding , & errors )) {
4342        return  NULL ;
4443    }
45-     assert (encoding  !=  NULL );
4644    return  PyCodec_Encode (input , encoding , errors );
4745}
4846
@@ -52,32 +50,29 @@ codec_decode(PyObject *Py_UNUSED(module), PyObject *args)
5250    PyObject  * input ;
5351    const  char  * encoding ;   // should not be NULL 
5452    const  char  * errors ;     // can be NULL 
55-     if  (!PyArg_ParseTuple (args , "O|zz " , & input , & encoding , & errors )) {
53+     if  (!PyArg_ParseTuple (args , "O|sz " , & input , & encoding , & errors )) {
5654        return  NULL ;
5755    }
58-     assert (encoding  !=  NULL );
5956    return  PyCodec_Decode (input , encoding , errors );
6057}
6158
6259static  PyObject  * 
6360codec_encoder (PyObject  * Py_UNUSED (module ), PyObject  * args )
6461{
6562    const  char  * encoding ;  // should not be NULL 
66-     if  (!PyArg_ParseTuple (args , "z " , & encoding )) {
63+     if  (!PyArg_ParseTuple (args , "s " , & encoding )) {
6764        return  NULL ;
6865    }
69-     assert (encoding  !=  NULL );
7066    return  PyCodec_Encoder (encoding );
7167}
7268
7369static  PyObject  * 
7470codec_decoder (PyObject  * Py_UNUSED (module ), PyObject  * args )
7571{
7672    const  char  * encoding ;  // should not be NULL 
77-     if  (!PyArg_ParseTuple (args , "z " , & encoding )) {
73+     if  (!PyArg_ParseTuple (args , "s " , & encoding )) {
7874        return  NULL ;
7975    }
80-     assert (encoding  !=  NULL );
8176    return  PyCodec_Decoder (encoding );
8277}
8378
@@ -86,11 +81,9 @@ codec_incremental_encoder(PyObject *Py_UNUSED(module), PyObject *args)
8681{
8782    const  char  * encoding ;   // should not be NULL 
8883    const  char  * errors ;     // should not be NULL 
89-     if  (!PyArg_ParseTuple (args , "zz " , & encoding , & errors )) {
84+     if  (!PyArg_ParseTuple (args , "ss " , & encoding , & errors )) {
9085        return  NULL ;
9186    }
92-     assert (encoding  !=  NULL );
93-     assert (errors  !=  NULL );
9487    return  PyCodec_IncrementalEncoder (encoding , errors );
9588}
9689
@@ -99,11 +92,9 @@ codec_incremental_decoder(PyObject *Py_UNUSED(module), PyObject *args)
9992{
10093    const  char  * encoding ;   // should not be NULL 
10194    const  char  * errors ;     // should not be NULL 
102-     if  (!PyArg_ParseTuple (args , "zz " , & encoding , & errors )) {
95+     if  (!PyArg_ParseTuple (args , "ss " , & encoding , & errors )) {
10396        return  NULL ;
10497    }
105-     assert (encoding  !=  NULL );
106-     assert (errors  !=  NULL );
10798    return  PyCodec_IncrementalDecoder (encoding , errors );
10899}
109100
@@ -113,11 +104,9 @@ codec_stream_reader(PyObject *Py_UNUSED(module), PyObject *args)
113104    const  char  * encoding ;  // should not be NULL 
114105    PyObject  * stream ;
115106    const  char  * errors ;    // should not be NULL 
116-     if  (!PyArg_ParseTuple (args , "zOz " , & encoding , & stream , & errors )) {
107+     if  (!PyArg_ParseTuple (args , "sOs " , & encoding , & stream , & errors )) {
117108        return  NULL ;
118109    }
119-     assert (encoding  !=  NULL );
120-     assert (errors  !=  NULL );
121110    return  PyCodec_StreamReader (encoding , stream , errors );
122111}
123112
@@ -127,11 +116,9 @@ codec_stream_writer(PyObject *Py_UNUSED(module), PyObject *args)
127116    const  char  * encoding ;  // should not be NULL 
128117    PyObject  * stream ;
129118    const  char  * errors ;    // should not be NULL 
130-     if  (!PyArg_ParseTuple (args , "zOz " , & encoding , & stream , & errors )) {
119+     if  (!PyArg_ParseTuple (args , "sOs " , & encoding , & stream , & errors )) {
131120        return  NULL ;
132121    }
133-     assert (encoding  !=  NULL );
134-     assert (errors  !=  NULL );
135122    return  PyCodec_StreamWriter (encoding , stream , errors );
136123}
137124
@@ -142,10 +129,9 @@ codec_register_error(PyObject *Py_UNUSED(module), PyObject *args)
142129{
143130    const  char  * encoding ;  // should not be NULL 
144131    PyObject  * error ;
145-     if  (!PyArg_ParseTuple (args , "zO " , & encoding , & error )) {
132+     if  (!PyArg_ParseTuple (args , "sO " , & encoding , & error )) {
146133        return  NULL ;
147134    }
148-     assert (encoding  !=  NULL );
149135    if  (PyCodec_RegisterError (encoding , error ) <  0 ) {
150136        return  NULL ;
151137    }
0 commit comments