Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Side by Side Diff: Modules/_io/textio.c

Issue 28261: wrong error messages when using PyArg_ParseTuple to parse normal tuples
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 An implementation of Text I/O as defined by PEP 3116 - "New I/O" 2 An implementation of Text I/O as defined by PEP 3116 - "New I/O"
3 3
4 Classes defined here: TextIOBase, IncrementalNewlineDecoder, TextIOWrapper. 4 Classes defined here: TextIOBase, IncrementalNewlineDecoder, TextIOWrapper.
5 5
6 Written by Amaury Forgeot d'Arc and Antoine Pitrou 6 Written by Amaury Forgeot d'Arc and Antoine Pitrou
7 */ 7 */
8 8
9 #define PY_SSIZE_T_CLEAN 9 #define PY_SSIZE_T_CLEAN
10 #include "Python.h" 10 #include "Python.h"
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 [clinic start generated code]*/ 562 [clinic start generated code]*/
563 563
564 static PyObject * 564 static PyObject *
565 _io_IncrementalNewlineDecoder_setstate(nldecoder_object *self, 565 _io_IncrementalNewlineDecoder_setstate(nldecoder_object *self,
566 PyObject *state) 566 PyObject *state)
567 /*[clinic end generated code: output=c10c622508b576cb input=c53fb505a76dbbe2]*/ 567 /*[clinic end generated code: output=c10c622508b576cb input=c53fb505a76dbbe2]*/
568 { 568 {
569 PyObject *buffer; 569 PyObject *buffer;
570 unsigned long long flag; 570 unsigned long long flag;
571 571
572 if (!PyArg_ParseTuple(state, "OK", &buffer, &flag)) 572 if (!PyArg_ParseTuple(state,
573 "OK;IncrementalNewlineDecoder.setstate: illegal "
574 "state argument", &buffer, &flag)) {
573 return NULL; 575 return NULL;
576 }
574 577
575 self->pendingcr = (int) (flag & 1); 578 self->pendingcr = (int) (flag & 1);
576 flag >>= 1; 579 flag >>= 1;
577 580
578 if (self->decoder != Py_None) 581 if (self->decoder != Py_None)
579 return _PyObject_CallMethodId(self->decoder, 582 return _PyObject_CallMethodId(self->decoder,
580 &PyId_setstate, "((OK))", buffer, flag); 583 &PyId_setstate, "((OK))", buffer, flag);
581 else 584 else
582 Py_RETURN_NONE; 585 Py_RETURN_NONE;
583 } 586 }
(...skipping 2333 matching lines...) Expand 10 before | Expand all | Expand 10 after
2917 0, /* tp_is_gc */ 2920 0, /* tp_is_gc */
2918 0, /* tp_bases */ 2921 0, /* tp_bases */
2919 0, /* tp_mro */ 2922 0, /* tp_mro */
2920 0, /* tp_cache */ 2923 0, /* tp_cache */
2921 0, /* tp_subclasses */ 2924 0, /* tp_subclasses */
2922 0, /* tp_weaklist */ 2925 0, /* tp_weaklist */
2923 0, /* tp_del */ 2926 0, /* tp_del */
2924 0, /* tp_version_tag */ 2927 0, /* tp_version_tag */
2925 0, /* tp_finalize */ 2928 0, /* tp_finalize */
2926 }; 2929 };
OLDNEW

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+