Core and Builtins
-----------------
+ - Issue #13333: The UTF-7 decoder now accepts lone surrogates (the encoder
+ already accepts them).
+
+- Issue #13389: Full garbage collection passes now clear the freelists for
+ list and dict objects. They already cleared other freelists in the
+ interpreter.
+
+- Issue #13327: Remove the need for an explicit None as the second argument
+ to os.utime, os.lutimes, os.futimes, os.futimens, os.futimesat, in
+ order to update to the current time. Also added keyword argument
+ handling to os.utimensat in order to remove the need for explicit None.
+
+- Issue #13350: Simplify some C code by replacing most usages of
+ PyUnicode_Format by PyUnicode_FromFormat.
+
- Issue #13342: input() used to ignore sys.stdin's and sys.stdout's unicode
error handler in interactive mode (when calling into PyOS_Readline()).
if (surrogate) {
/* expecting a second surrogate */
if (outCh >= 0xDC00 && outCh <= 0xDFFF) {
-#ifdef Py_UNICODE_WIDE
- *p++ = (((surrogate & 0x3FF)<<10)
- | (outCh & 0x3FF)) + 0x10000;
-#else
- *p++ = surrogate;
- *p++ = outCh;
-#endif
+ Py_UCS4 ch2 = (((surrogate & 0x3FF)<<10)
+ | (outCh & 0x3FF)) + 0x10000;
+ if (unicode_putchar(&unicode, &outpos, ch2) < 0)
+ goto onError;
surrogate = 0;
+ continue;
}
else {
- *p++ = surrogate;
++ if (unicode_putchar(&unicode, &outpos, surrogate) < 0)
++ goto onError;
surrogate = 0;
- errmsg = "second surrogate missing";
- goto utf7Error;
}
}
- else if (outCh >= 0xD800 && outCh <= 0xDBFF) {
+ if (outCh >= 0xD800 && outCh <= 0xDBFF) {
/* first surrogate */
surrogate = outCh;
}
- else if (outCh >= 0xDC00 && outCh <= 0xDFFF) {
- errmsg = "unexpected second surrogate";
- goto utf7Error;
- }
else {
- *p++ = outCh;
+ if (unicode_putchar(&unicode, &outpos, outCh) < 0)
+ goto onError;
}
}
}
inShift = 0;
s++;
if (surrogate) {
- errmsg = "second surrogate missing at end of shift sequence";
- goto utf7Error;
- *p++ = surrogate;
++ if (unicode_putchar(&unicode, &outpos, surrogate) < 0)
++ goto onError;
+ surrogate = 0;
}
if (base64bits > 0) { /* left-over bits */
if (base64bits >= 6) {