@@ -108,16 +108,16 @@ Tuple_to_LDAPMod( PyObject* tup, int no_op )
108
108
Py_ssize_t i , len , nstrs ;
109
109
110
110
if (!PyTuple_Check (tup )) {
111
- LDAPerror_TypeError ("expected a tuple" , tup );
111
+ LDAPerror_TypeError ("Tuple_to_LDAPMod(): expected a tuple" , tup );
112
112
return NULL ;
113
113
}
114
114
115
115
if (no_op ) {
116
- if (!PyArg_ParseTuple ( tup , "sO" , & type , & list ))
116
+ if (!PyArg_ParseTuple ( tup , "sO:Tuple_to_LDAPMod " , & type , & list ))
117
117
return NULL ;
118
118
op = 0 ;
119
119
} else {
120
- if (!PyArg_ParseTuple ( tup , "isO" , & op , & type , & list ))
120
+ if (!PyArg_ParseTuple ( tup , "isO:Tuple_to_LDAPMod " , & op , & type , & list ))
121
121
return NULL ;
122
122
}
123
123
@@ -161,7 +161,7 @@ Tuple_to_LDAPMod( PyObject* tup, int no_op )
161
161
if (item == NULL )
162
162
goto error ;
163
163
if (!PyBytes_Check (item )) {
164
- LDAPerror_TypeError ("expected a byte string in the list" , item );
164
+ LDAPerror_TypeError ("Tuple_to_LDAPMod(): expected a byte string in the list" , item );
165
165
goto error ;
166
166
}
167
167
lm -> mod_bvalues [i ]-> bv_len = PyBytes_Size (item );
@@ -206,14 +206,14 @@ List_to_LDAPMods( PyObject *list, int no_op ) {
206
206
PyObject * item ;
207
207
208
208
if (!PySequence_Check (list )) {
209
- LDAPerror_TypeError ("expected list of tuples" , list );
209
+ LDAPerror_TypeError ("List_to_LDAPMods(): expected list of tuples" , list );
210
210
return NULL ;
211
211
}
212
212
213
213
len = PySequence_Length (list );
214
214
215
215
if (len < 0 ) {
216
- LDAPerror_TypeError ("expected list of tuples" , list );
216
+ LDAPerror_TypeError ("List_to_LDAPMods(): expected list of tuples" , list );
217
217
return NULL ;
218
218
}
219
219
@@ -262,7 +262,7 @@ attrs_from_List( PyObject *attrlist, char***attrsp) {
262
262
#endif
263
263
/* caught by John Benninghoff <johnb@netscape.com> */
264
264
LDAPerror_TypeError (
265
- "expected *list* of strings, not a string" , attrlist );
265
+ "attrs_from_List(): expected *list* of strings, not a string" , attrlist );
266
266
goto error ;
267
267
} else {
268
268
PyObject * item = NULL ;
@@ -291,15 +291,15 @@ attrs_from_List( PyObject *attrlist, char***attrsp) {
291
291
#if PY_MAJOR_VERSION == 2
292
292
/* Encoded in Python to UTF-8 */
293
293
if (!PyBytes_Check (item )) {
294
- LDAPerror_TypeError ("expected bytes in list" , item );
294
+ LDAPerror_TypeError ("attrs_from_List(): expected bytes in list" , item );
295
295
goto error ;
296
296
}
297
297
if (PyBytes_AsStringAndSize (item , & str , & strlen ) == -1 ) {
298
298
goto error ;
299
299
}
300
300
#else
301
301
if (!PyUnicode_Check (item )) {
302
- LDAPerror_TypeError ("expected string in list" , item );
302
+ LDAPerror_TypeError ("attrs_from_List(): expected string in list" , item );
303
303
goto error ;
304
304
}
305
305
str = PyUnicode_AsUTF8AndSize (item , & strlen );
@@ -361,7 +361,7 @@ l_ldap_unbind_ext( LDAPObject* self, PyObject* args )
361
361
362
362
int ldaperror ;
363
363
364
- if (!PyArg_ParseTuple ( args , "|OO" , & serverctrls , & clientctrls )) return NULL ;
364
+ if (!PyArg_ParseTuple ( args , "|OO:unbind_ext " , & serverctrls , & clientctrls )) return NULL ;
365
365
if (not_valid (self )) return NULL ;
366
366
367
367
if (!PyNone_Check (serverctrls )) {
@@ -404,7 +404,7 @@ l_ldap_abandon_ext( LDAPObject* self, PyObject* args )
404
404
405
405
int ldaperror ;
406
406
407
- if (!PyArg_ParseTuple ( args , "i|OO" , & msgid , & serverctrls , & clientctrls )) return NULL ;
407
+ if (!PyArg_ParseTuple ( args , "i|OO:abandon_ext " , & msgid , & serverctrls , & clientctrls )) return NULL ;
408
408
if (not_valid (self )) return NULL ;
409
409
410
410
if (!PyNone_Check (serverctrls )) {
@@ -449,7 +449,7 @@ l_ldap_add_ext( LDAPObject* self, PyObject *args )
449
449
int ldaperror ;
450
450
LDAPMod * * mods ;
451
451
452
- if (!PyArg_ParseTuple ( args , "sO|OO" , & dn , & modlist , & serverctrls , & clientctrls )) return NULL ;
452
+ if (!PyArg_ParseTuple ( args , "sO|OO:add_ext " , & dn , & modlist , & serverctrls , & clientctrls )) return NULL ;
453
453
if (not_valid (self )) return NULL ;
454
454
455
455
mods = List_to_LDAPMods ( modlist , 1 );
@@ -499,7 +499,7 @@ l_ldap_simple_bind( LDAPObject* self, PyObject* args )
499
499
LDAPControl * * client_ldcs = NULL ;
500
500
struct berval cred ;
501
501
502
- if (!PyArg_ParseTuple ( args , "zz#|OO" , & who , & cred .bv_val , & cred_len , & serverctrls , & clientctrls )) return NULL ;
502
+ if (!PyArg_ParseTuple ( args , "zz#|OO:simple_bind " , & who , & cred .bv_val , & cred_len , & serverctrls , & clientctrls )) return NULL ;
503
503
cred .bv_len = (ber_len_t ) cred_len ;
504
504
505
505
if (not_valid (self )) return NULL ;
@@ -649,7 +649,7 @@ l_ldap_sasl_bind_s( LDAPObject* self, PyObject* args )
649
649
struct berval * servercred ;
650
650
int ldaperror ;
651
651
652
- if (!PyArg_ParseTuple (args , "zzz#OO" , & dn , & mechanism , & cred .bv_val , & cred_len , & serverctrls , & clientctrls ))
652
+ if (!PyArg_ParseTuple (args , "zzz#OO:sasl_bind_s " , & dn , & mechanism , & cred .bv_val , & cred_len , & serverctrls , & clientctrls ))
653
653
return NULL ;
654
654
655
655
if (not_valid (self )) return NULL ;
@@ -713,9 +713,9 @@ l_ldap_sasl_interactive_bind_s( LDAPObject* self, PyObject* args )
713
713
* "i" otherwise.
714
714
*/
715
715
#if (PY_MAJOR_VERSION == 2 ) && (PY_MINOR_VERSION < 3 )
716
- if (!PyArg_ParseTuple (args , "sOOOi" , & who , & SASLObject , & serverctrls , & clientctrls , & sasl_flags ))
716
+ if (!PyArg_ParseTuple (args , "sOOOi:sasl_interactive_bind_s " , & who , & SASLObject , & serverctrls , & clientctrls , & sasl_flags ))
717
717
#else
718
- if (!PyArg_ParseTuple (args , "sOOOI" , & who , & SASLObject , & serverctrls , & clientctrls , & sasl_flags ))
718
+ if (!PyArg_ParseTuple (args , "sOOOI:sasl_interactive_bind_s " , & who , & SASLObject , & serverctrls , & clientctrls , & sasl_flags ))
719
719
#endif
720
720
return NULL ;
721
721
@@ -780,7 +780,7 @@ l_ldap_cancel( LDAPObject* self, PyObject* args )
780
780
781
781
int ldaperror ;
782
782
783
- if (!PyArg_ParseTuple ( args , "i|OO" , & cancelid , & serverctrls , & clientctrls )) return NULL ;
783
+ if (!PyArg_ParseTuple ( args , "i|OO:cancel " , & cancelid , & serverctrls , & clientctrls )) return NULL ;
784
784
if (not_valid (self )) return NULL ;
785
785
786
786
if (!PyNone_Check (serverctrls )) {
@@ -826,7 +826,7 @@ l_ldap_compare_ext( LDAPObject* self, PyObject *args )
826
826
Py_ssize_t value_len ;
827
827
struct berval value ;
828
828
829
- if (!PyArg_ParseTuple ( args , "sss#|OO" , & dn , & attr , & value .bv_val , & value_len , & serverctrls , & clientctrls )) return NULL ;
829
+ if (!PyArg_ParseTuple ( args , "sss#|OO:compare_ext " , & dn , & attr , & value .bv_val , & value_len , & serverctrls , & clientctrls )) return NULL ;
830
830
value .bv_len = (ber_len_t ) value_len ;
831
831
832
832
if (not_valid (self )) return NULL ;
@@ -871,7 +871,7 @@ l_ldap_delete_ext( LDAPObject* self, PyObject *args )
871
871
int msgid ;
872
872
int ldaperror ;
873
873
874
- if (!PyArg_ParseTuple ( args , "s|OO" , & dn , & serverctrls , & clientctrls )) return NULL ;
874
+ if (!PyArg_ParseTuple ( args , "s|OO:delete_ext " , & dn , & serverctrls , & clientctrls )) return NULL ;
875
875
if (not_valid (self )) return NULL ;
876
876
877
877
if (!PyNone_Check (serverctrls )) {
@@ -916,7 +916,7 @@ l_ldap_modify_ext( LDAPObject* self, PyObject *args )
916
916
int ldaperror ;
917
917
LDAPMod * * mods ;
918
918
919
- if (!PyArg_ParseTuple ( args , "sO|OO" , & dn , & modlist , & serverctrls , & clientctrls )) return NULL ;
919
+ if (!PyArg_ParseTuple ( args , "sO|OO:modify_ext " , & dn , & modlist , & serverctrls , & clientctrls )) return NULL ;
920
920
if (not_valid (self )) return NULL ;
921
921
922
922
mods = List_to_LDAPMods ( modlist , 0 );
@@ -969,7 +969,7 @@ l_ldap_rename( LDAPObject* self, PyObject *args )
969
969
int msgid ;
970
970
int ldaperror ;
971
971
972
- if (!PyArg_ParseTuple ( args , "ss|ziOO" , & dn , & newrdn , & newSuperior , & delold , & serverctrls , & clientctrls ))
972
+ if (!PyArg_ParseTuple ( args , "ss|ziOO:rename " , & dn , & newrdn , & newSuperior , & delold , & serverctrls , & clientctrls ))
973
973
return NULL ;
974
974
if (not_valid (self )) return NULL ;
975
975
@@ -1022,7 +1022,7 @@ l_ldap_result4( LDAPObject* self, PyObject *args )
1022
1022
char * * refs = NULL ;
1023
1023
LDAPControl * * serverctrls = 0 ;
1024
1024
1025
- if (!PyArg_ParseTuple ( args , "|iidiii" , & msgid , & all , & timeout , & add_ctrls , & add_intermediates , & add_extop ))
1025
+ if (!PyArg_ParseTuple ( args , "|iidiii:result4 " , & msgid , & all , & timeout , & add_ctrls , & add_intermediates , & add_extop ))
1026
1026
return NULL ;
1027
1027
if (not_valid (self )) return NULL ;
1028
1028
@@ -1162,7 +1162,7 @@ l_ldap_search_ext( LDAPObject* self, PyObject* args )
1162
1162
int msgid ;
1163
1163
int ldaperror ;
1164
1164
1165
- if (!PyArg_ParseTuple ( args , "sis|OiOOdi" ,
1165
+ if (!PyArg_ParseTuple ( args , "sis|OiOOdi:search_ext " ,
1166
1166
& base , & scope , & filter , & attrlist , & attrsonly ,
1167
1167
& serverctrls , & clientctrls , & timeout , & sizelimit )) return NULL ;
1168
1168
if (not_valid (self )) return NULL ;
@@ -1224,7 +1224,7 @@ l_ldap_whoami_s( LDAPObject* self, PyObject* args )
1224
1224
1225
1225
int ldaperror ;
1226
1226
1227
- if (!PyArg_ParseTuple ( args , "|OO" , & serverctrls , & clientctrls )) return NULL ;
1227
+ if (!PyArg_ParseTuple ( args , "|OO:whoami_s " , & serverctrls , & clientctrls )) return NULL ;
1228
1228
if (not_valid (self )) return NULL ;
1229
1229
1230
1230
if (!PyNone_Check (serverctrls )) {
@@ -1265,7 +1265,7 @@ l_ldap_start_tls_s( LDAPObject* self, PyObject* args )
1265
1265
{
1266
1266
int ldaperror ;
1267
1267
1268
- if (!PyArg_ParseTuple ( args , "" )) return NULL ;
1268
+ if (!PyArg_ParseTuple ( args , ":start_tls_s " )) return NULL ;
1269
1269
if (not_valid (self )) return NULL ;
1270
1270
1271
1271
LDAP_BEGIN_ALLOW_THREADS ( self );
@@ -1331,7 +1331,7 @@ l_ldap_passwd( LDAPObject* self, PyObject *args )
1331
1331
int msgid ;
1332
1332
int ldaperror ;
1333
1333
1334
- if (!PyArg_ParseTuple ( args , "z#z#z#|OO" , & user .bv_val , & user_len , & oldpw .bv_val , & oldpw_len , & newpw .bv_val , & newpw_len , & serverctrls , & clientctrls ))
1334
+ if (!PyArg_ParseTuple ( args , "z#z#z#|OO:passwd " , & user .bv_val , & user_len , & oldpw .bv_val , & oldpw_len , & newpw .bv_val , & newpw_len , & serverctrls , & clientctrls ))
1335
1335
return NULL ;
1336
1336
1337
1337
user .bv_len = (ber_len_t ) user_len ;
@@ -1387,7 +1387,7 @@ l_ldap_extended_operation( LDAPObject* self, PyObject *args )
1387
1387
int msgid ;
1388
1388
int ldaperror ;
1389
1389
1390
- if (!PyArg_ParseTuple ( args , "sz#|OO" , & reqoid , & reqvalue .bv_val , & reqvalue .bv_len , & serverctrls , & clientctrls ))
1390
+ if (!PyArg_ParseTuple ( args , "sz#|OO:extended_operation " , & reqoid , & reqvalue .bv_val , & reqvalue .bv_len , & serverctrls , & clientctrls ))
1391
1391
return NULL ;
1392
1392
1393
1393
if (not_valid (self )) return NULL ;
0 commit comments