diff -prU2 Modules/_io/textio.c Modules/_io/textio.c --- Modules/_io/textio.c +++ Modules/_io/textio.c @@ -191,6 +191,6 @@ typedef struct { PyObject *decoder; PyObject *errors; - signed int pendingcr: 1; - signed int translate: 1; + unsigned int pendingcr: 1; + unsigned int translate: 1; unsigned int seennl: 3; } nldecoder_object; @@ -511,5 +511,5 @@ incrementalnewlinedecoder_setstate(nldec return NULL; - self->pendingcr = (int) flag & 1; + self->pendingcr = (int) (flag & 1); flag>>= 1;