diff -Nru python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/fixes/fix_apply.py python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/fixes/fix_apply.py --- python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/fixes/fix_apply.py 2019-10-14 22:32:36.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/fixes/fix_apply.py 2019-12-18 18:48:49.000000000 +0000 @@ -37,10 +37,8 @@ # I feel like we should be able to express this logic in the # PATTERN above but I don't know how to do it so... if args: - if args.type == self.syms.star_expr: - return # Make no change. if (args.type == self.syms.argument and - args.children[0].value == '**'): + args.children[0].value in {'**', '*'}): return # Make no change. if kwds and (kwds.type == self.syms.argument and kwds.children[0].value == '**'): diff -Nru python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/fixes/fix_intern.py python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/fixes/fix_intern.py --- python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/fixes/fix_intern.py 2019-10-14 22:32:36.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/fixes/fix_intern.py 2019-12-18 18:48:49.000000000 +0000 @@ -30,10 +30,8 @@ # PATTERN above but I don't know how to do it so... obj = results['obj'] if obj: - if obj.type == self.syms.star_expr: - return # Make no change. if (obj.type == self.syms.argument and - obj.children[0].value == '**'): + obj.children[0].value in {'**', '*'}): return # Make no change. names = ('sys', 'intern') new = ImportAndCall(node, results, names) diff -Nru python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/fixes/fix_reload.py python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/fixes/fix_reload.py --- python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/fixes/fix_reload.py 2019-10-14 22:32:36.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/fixes/fix_reload.py 2019-12-18 18:48:49.000000000 +0000 @@ -27,10 +27,8 @@ # PATTERN above but I don't know how to do it so... obj = results['obj'] if obj: - if obj.type == self.syms.star_expr: - return # Make no change. if (obj.type == self.syms.argument and - obj.children[0].value == '**'): + obj.children[0].value in {'**', '*'}): return # Make no change. names = ('importlib', 'reload') new = ImportAndCall(node, results, names) diff -Nru python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/Grammar.txt python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/Grammar.txt --- python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/Grammar.txt 2019-10-14 22:32:36.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/Grammar.txt 2019-12-18 18:48:49.000000000 +0000 @@ -138,8 +138,8 @@ # that precede iterable unpackings are blocked; etc. argument: ( test [comp_for] | test '=' test | - '**' expr | - star_expr ) + '**' test | + '*' test ) comp_iter: comp_for | comp_if comp_for: [ASYNC] 'for' exprlist 'in' testlist_safe [comp_iter] diff -Nru python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/tests/test_parser.py python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/tests/test_parser.py --- python3-stdlib-extensions-3.8.0/3.7/Lib/lib2to3/tests/test_parser.py 2019-10-14 22:32:36.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.7/Lib/lib2to3/tests/test_parser.py 2019-12-18 18:48:49.000000000 +0000 @@ -253,6 +253,13 @@ def test_double_star_dict_literal_after_keywords(self): self.validate("""func(spam='fried', **{'eggs':'scrambled'})""") + def test_double_star_expression(self): + self.validate("""func(**{'a':2} or {})""") + self.validate("""func(**() or {})""") + + def test_star_expression(self): + self.validate("""func(*[] or [2])""") + def test_list_display(self): self.validate("""[*{2}, 3, *[4]]""") diff -Nru python3-stdlib-extensions-3.8.0/3.7/Lib/tkinter/__init__.py python3-stdlib-extensions-3.8.2/3.7/Lib/tkinter/__init__.py --- python3-stdlib-extensions-3.8.0/3.7/Lib/tkinter/__init__.py 2019-10-14 22:32:36.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.7/Lib/tkinter/__init__.py 2019-12-18 18:48:49.000000000 +0000 @@ -969,7 +969,7 @@ """Return window class name of this widget.""" return self.tk.call('winfo', 'class', self._w) def winfo_colormapfull(self): - """Return true if at the last color request the colormap was full.""" + """Return True if at the last color request the colormap was full.""" return self.tk.getboolean( self.tk.call('winfo', 'colormapfull', self._w)) def winfo_containing(self, rootX, rootY, displayof=0): @@ -2829,7 +2829,7 @@ 'selection', 'clear', first, last) select_clear = selection_clear def selection_includes(self, index): - """Return 1 if INDEX is part of the selection.""" + """Return True if INDEX is part of the selection.""" return self.tk.getboolean(self.tk.call( self._w, 'selection', 'includes', index)) select_includes = selection_includes diff -Nru python3-stdlib-extensions-3.8.0/3.7/Lib/tkinter/test/test_tkinter/test_misc.py python3-stdlib-extensions-3.8.2/3.7/Lib/tkinter/test/test_tkinter/test_misc.py --- python3-stdlib-extensions-3.8.0/3.7/Lib/tkinter/test/test_tkinter/test_misc.py 2019-10-14 22:32:36.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.7/Lib/tkinter/test/test_tkinter/test_misc.py 2019-12-18 18:48:49.000000000 +0000 @@ -156,6 +156,28 @@ with self.assertRaises(tkinter.TclError): root.tk.call('after', 'info', idle1) + def test_clipboard(self): + root = self.root + root.clipboard_clear() + root.clipboard_append('Ùñî') + self.assertEqual(root.clipboard_get(), 'Ùñî') + root.clipboard_append('çōđě') + self.assertEqual(root.clipboard_get(), 'Ùñîçōđě') + root.clipboard_clear() + with self.assertRaises(tkinter.TclError): + root.clipboard_get() + + def test_clipboard_astral(self): + root = self.root + root.clipboard_clear() + root.clipboard_append('𝔘𝔫𝔦') + self.assertEqual(root.clipboard_get(), '𝔘𝔫𝔦') + root.clipboard_append('𝔠𝔬𝔡𝔢') + self.assertEqual(root.clipboard_get(), '𝔘𝔫𝔦𝔠𝔬𝔡𝔢') + root.clipboard_clear() + with self.assertRaises(tkinter.TclError): + root.clipboard_get() + tests_gui = (MiscTest, ) diff -Nru python3-stdlib-extensions-3.8.0/3.7/Lib/tkinter/test/test_ttk/test_widgets.py python3-stdlib-extensions-3.8.2/3.7/Lib/tkinter/test/test_ttk/test_widgets.py --- python3-stdlib-extensions-3.8.0/3.7/Lib/tkinter/test/test_ttk/test_widgets.py 2019-10-14 22:32:36.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.7/Lib/tkinter/test/test_ttk/test_widgets.py 2019-12-18 18:48:49.000000000 +0000 @@ -489,8 +489,7 @@ expected=('mon', 'tue', 'wed', 'thur')) self.checkParam(self.combo, 'values', ('mon', 'tue', 'wed', 'thur')) self.checkParam(self.combo, 'values', (42, 3.14, '', 'any string')) - self.checkParam(self.combo, 'values', '', - expected='' if get_tk_patchlevel() < (8, 5, 10) else ()) + self.checkParam(self.combo, 'values', '') self.combo['values'] = ['a', 1, 'c'] @@ -1245,12 +1244,7 @@ expected=('mon', 'tue', 'wed', 'thur')) self.checkParam(self.spin, 'values', ('mon', 'tue', 'wed', 'thur')) self.checkParam(self.spin, 'values', (42, 3.14, '', 'any string')) - self.checkParam( - self.spin, - 'values', - '', - expected='' if get_tk_patchlevel() < (8, 5, 10) else () - ) + self.checkParam(self.spin, 'values', '') self.spin['values'] = ['a', 1, 'c'] @@ -1308,8 +1302,7 @@ self.checkParam(widget, 'columns', 'a b c', expected=('a', 'b', 'c')) self.checkParam(widget, 'columns', ('a', 'b', 'c')) - self.checkParam(widget, 'columns', (), - expected='' if get_tk_patchlevel() < (8, 5, 10) else ()) + self.checkParam(widget, 'columns', '') def test_displaycolumns(self): widget = self.create() diff -Nru python3-stdlib-extensions-3.8.0/3.7/Modules/_tkinter.c python3-stdlib-extensions-3.8.2/3.7/Modules/_tkinter.c --- python3-stdlib-extensions-3.8.0/3.7/Modules/_tkinter.c 2019-10-14 22:32:36.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.7/Modules/_tkinter.c 2019-12-18 18:48:49.000000000 +0000 @@ -96,6 +96,24 @@ #endif /* HAVE_CREATEFILEHANDLER */ +/* Use OS native encoding for converting between Python strings and + Tcl objects. + On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the + "surrogatepass" error handler for converting to/from Tcl Unicode objects. + On Linux use UTF-8 with the "surrogateescape" error handler for converting + to/from Tcl String objects. */ +#ifdef MS_WINDOWS +#define USE_TCL_UNICODE 1 +#else +#define USE_TCL_UNICODE 0 +#endif + +#if PY_LITTLE_ENDIAN +#define NATIVE_BYTEORDER -1 +#else +#define NATIVE_BYTEORDER 1 +#endif + #ifdef MS_WINDOWS #include #define WAIT_FOR_STDIN @@ -290,7 +308,6 @@ } TkappObject; #define Tkapp_Interp(v) (((TkappObject *) (v))->interp) -#define Tkapp_Result(v) Tcl_GetStringResult(Tkapp_Interp(v)) #define DEBUG_REFCNT(v) (printf("DEBUG: id=%p, refcnt=%i\n", \ (void *) v, Py_REFCNT(v))) @@ -311,10 +328,16 @@ #endif +static PyObject *Tkapp_UnicodeResult(TkappObject *); + static PyObject * -Tkinter_Error(PyObject *v) +Tkinter_Error(TkappObject *self) { - PyErr_SetString(Tkinter_TclError, Tkapp_Result(v)); + PyObject *res = Tkapp_UnicodeResult(self); + if (res != NULL) { + PyErr_SetObject(Tkinter_TclError, res); + Py_DECREF(res); + } return NULL; } @@ -368,30 +391,35 @@ unicodeFromTclStringAndSize(const char *s, Py_ssize_t size) { PyObject *r = PyUnicode_DecodeUTF8(s, size, NULL); - if (!r && PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) { - /* Tcl encodes null character as \xc0\x80 */ - if (memchr(s, '\xc0', size)) { - char *buf, *q; - const char *e = s + size; - PyErr_Clear(); - q = buf = (char *)PyMem_Malloc(size); - if (buf == NULL) { - PyErr_NoMemory(); - return NULL; - } - while (s != e) { - if (s + 1 != e && s[0] == '\xc0' && s[1] == '\x80') { - *q++ = '\0'; - s += 2; - } - else - *q++ = *s++; + if (r != NULL || !PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) { + return r; + } + + char *buf = NULL; + PyErr_Clear(); + /* Tcl encodes null character as \xc0\x80 */ + if (memchr(s, '\xc0', size)) { + char *q; + const char *e = s + size; + q = buf = (char *)PyMem_Malloc(size); + if (buf == NULL) { + PyErr_NoMemory(); + return NULL; + } + while (s != e) { + if (s + 1 != e && s[0] == '\xc0' && s[1] == '\x80') { + *q++ = '\0'; + s += 2; } - s = buf; - size = q - s; - r = PyUnicode_DecodeUTF8(s, size, NULL); - PyMem_Free(buf); + else + *q++ = *s++; } + s = buf; + size = q - s; + } + r = PyUnicode_DecodeUTF8(s, size, "surrogateescape"); + if (buf != NULL) { + PyMem_Free(buf); } return r; } @@ -406,8 +434,21 @@ unicodeFromTclObj(Tcl_Obj *value) { int len; - char *s = Tcl_GetStringFromObj(value, &len); +#if USE_TCL_UNICODE + int byteorder = NATIVE_BYTEORDER; + const Tcl_UniChar *u = Tcl_GetUnicodeFromObj(value, &len); + if (sizeof(Tcl_UniChar) == 2) + return PyUnicode_DecodeUTF16((const char *)u, len * 2, + "surrogatepass", &byteorder); + else if (sizeof(Tcl_UniChar) == 4) + return PyUnicode_DecodeUTF32((const char *)u, len * 4, + "surrogatepass", &byteorder); + else + Py_UNREACHABLE(); +#else + const char *s = Tcl_GetStringFromObj(value, &len); return unicodeFromTclStringAndSize(s, len); +#endif } @@ -747,7 +788,7 @@ #endif if (Tcl_AppInit(v->interp) != TCL_OK) { - PyObject *result = Tkinter_Error((PyObject *)v); + PyObject *result = Tkinter_Error(v); #ifdef TKINTER_PROTECT_LOADTK if (wantTk) { const char *_tkinter_tk_failed; @@ -819,12 +860,6 @@ Py_DECREF(tp); } -static const char * -PyTclObject_TclString(PyObject *self) -{ - return Tcl_GetString(((PyTclObject*)self)->value); -} - /* Like _str, but create Unicode if necessary. */ PyDoc_STRVAR(PyTclObject_string__doc__, "the string representation of this object, either as str or bytes"); @@ -1050,53 +1085,51 @@ } if (PyUnicode_Check(value)) { - void *inbuf; - Py_ssize_t size; - int kind; - Tcl_UniChar *outbuf = NULL; - Py_ssize_t i; - size_t allocsize; - if (PyUnicode_READY(value) == -1) return NULL; - inbuf = PyUnicode_DATA(value); - size = PyUnicode_GET_LENGTH(value); - if (size == 0) - return Tcl_NewUnicodeObj((const void *)"", 0); + Py_ssize_t size = PyUnicode_GET_LENGTH(value); + if (size == 0) { + return Tcl_NewStringObj("", 0); + } if (!CHECK_SIZE(size, sizeof(Tcl_UniChar))) { PyErr_SetString(PyExc_OverflowError, "string is too long"); return NULL; } - kind = PyUnicode_KIND(value); - if (kind == sizeof(Tcl_UniChar)) - return Tcl_NewUnicodeObj(inbuf, (int)size); - allocsize = ((size_t)size) * sizeof(Tcl_UniChar); - outbuf = (Tcl_UniChar*)PyMem_Malloc(allocsize); - /* Else overflow occurred, and we take the next exit */ - if (!outbuf) { - PyErr_NoMemory(); - return NULL; + if (PyUnicode_IS_ASCII(value)) { + return Tcl_NewStringObj((const char *)PyUnicode_DATA(value), + (int)size); } - for (i = 0; i < size; i++) { - Py_UCS4 ch = PyUnicode_READ(kind, inbuf, i); - /* We cannot test for sizeof(Tcl_UniChar) directly, - so we test for UTF-8 size instead. */ -#if TCL_UTF_MAX == 3 - if (ch >= 0x10000) { - /* Tcl doesn't do UTF-16, yet. */ - PyErr_Format(Tkinter_TclError, - "character U+%x is above the range " - "(U+0000-U+FFFF) allowed by Tcl", - ch); - PyMem_Free(outbuf); - return NULL; - } + + PyObject *encoded; +#if USE_TCL_UNICODE + if (sizeof(Tcl_UniChar) == 2) + encoded = _PyUnicode_EncodeUTF16(value, + "surrogatepass", NATIVE_BYTEORDER); + else if (sizeof(Tcl_UniChar) == 4) + encoded = _PyUnicode_EncodeUTF32(value, + "surrogatepass", NATIVE_BYTEORDER); + else + Py_UNREACHABLE(); +#else + encoded = _PyUnicode_AsUTF8String(value, "surrogateescape"); #endif - outbuf[i] = ch; + if (!encoded) { + return NULL; } - result = Tcl_NewUnicodeObj(outbuf, (int)size); - PyMem_Free(outbuf); + size = PyBytes_GET_SIZE(encoded); + if (size > INT_MAX) { + Py_DECREF(encoded); + PyErr_SetString(PyExc_OverflowError, "string is too long"); + return NULL; + } +#if USE_TCL_UNICODE + result = Tcl_NewUnicodeObj((const Tcl_UniChar *)PyBytes_AS_STRING(encoded), + (int)(size / sizeof(Tcl_UniChar))); +#else + result = Tcl_NewStringObj(PyBytes_AS_STRING(encoded), (int)size); +#endif + Py_DECREF(encoded); return result; } @@ -1115,7 +1148,7 @@ } static PyObject * -fromBoolean(PyObject* tkapp, Tcl_Obj *value) +fromBoolean(TkappObject *tkapp, Tcl_Obj *value) { int boolValue; if (Tcl_GetBooleanFromObj(Tkapp_Interp(tkapp), value, &boolValue) == TCL_ERROR) @@ -1124,7 +1157,7 @@ } static PyObject* -fromWideIntObj(PyObject* tkapp, Tcl_Obj *value) +fromWideIntObj(TkappObject *tkapp, Tcl_Obj *value) { Tcl_WideInt wideValue; if (Tcl_GetWideIntFromObj(Tkapp_Interp(tkapp), value, &wideValue) == TCL_OK) { @@ -1140,7 +1173,7 @@ #ifdef HAVE_LIBTOMMAMTH static PyObject* -fromBignumObj(PyObject* tkapp, Tcl_Obj *value) +fromBignumObj(TkappObject *tkapp, Tcl_Obj *value) { mp_int bigValue; unsigned long numBytes; @@ -1176,32 +1209,31 @@ #endif static PyObject* -FromObj(PyObject* tkapp, Tcl_Obj *value) +FromObj(TkappObject *tkapp, Tcl_Obj *value) { PyObject *result = NULL; - TkappObject *app = (TkappObject*)tkapp; Tcl_Interp *interp = Tkapp_Interp(tkapp); if (value->typePtr == NULL) { - return unicodeFromTclStringAndSize(value->bytes, value->length); + return unicodeFromTclObj(value); } - if (value->typePtr == app->BooleanType || - value->typePtr == app->OldBooleanType) { + if (value->typePtr == tkapp->BooleanType || + value->typePtr == tkapp->OldBooleanType) { return fromBoolean(tkapp, value); } - if (value->typePtr == app->ByteArrayType) { + if (value->typePtr == tkapp->ByteArrayType) { int size; char *data = (char*)Tcl_GetByteArrayFromObj(value, &size); return PyBytes_FromStringAndSize(data, size); } - if (value->typePtr == app->DoubleType) { + if (value->typePtr == tkapp->DoubleType) { return PyFloat_FromDouble(value->internalRep.doubleValue); } - if (value->typePtr == app->IntType) { + if (value->typePtr == tkapp->IntType) { long longValue; if (Tcl_GetLongFromObj(interp, value, &longValue) == TCL_OK) return PyLong_FromLong(longValue); @@ -1209,8 +1241,8 @@ fall through to wideInt handling. */ } - if (value->typePtr == app->IntType || - value->typePtr == app->WideIntType) { + if (value->typePtr == tkapp->IntType || + value->typePtr == tkapp->WideIntType) { result = fromWideIntObj(tkapp, value); if (result != NULL || PyErr_Occurred()) return result; @@ -1220,14 +1252,14 @@ } #ifdef HAVE_LIBTOMMAMTH - if (value->typePtr == app->IntType || - value->typePtr == app->WideIntType || - value->typePtr == app->BignumType) { + if (value->typePtr == tkapp->IntType || + value->typePtr == tkapp->WideIntType || + value->typePtr == tkapp->BignumType) { return fromBignumObj(tkapp, value); } #endif - if (value->typePtr == app->ListType) { + if (value->typePtr == tkapp->ListType) { int size; int i, status; PyObject *elem; @@ -1255,30 +1287,28 @@ return result; } - if (value->typePtr == app->ProcBodyType) { + if (value->typePtr == tkapp->ProcBodyType) { /* fall through: return tcl object. */ } - if (value->typePtr == app->StringType) { - return PyUnicode_FromKindAndData( - sizeof(Tcl_UniChar), Tcl_GetUnicode(value), - Tcl_GetCharLength(value)); + if (value->typePtr == tkapp->StringType) { + return unicodeFromTclObj(value); } #if TK_HEX_VERSION >= 0x08050000 - if (app->BooleanType == NULL && + if (tkapp->BooleanType == NULL && strcmp(value->typePtr->name, "booleanString") == 0) { /* booleanString type is not registered in Tcl */ - app->BooleanType = value->typePtr; + tkapp->BooleanType = value->typePtr; return fromBoolean(tkapp, value); } #endif #ifdef HAVE_LIBTOMMAMTH - if (app->BignumType == NULL && + if (tkapp->BignumType == NULL && strcmp(value->typePtr->name, "bignum") == 0) { /* bignum type is not registered in Tcl */ - app->BignumType = value->typePtr; + tkapp->BignumType = value->typePtr; return fromBignumObj(tkapp, value); } #endif @@ -1368,19 +1398,28 @@ return NULL; } +/* Convert the results of a command call into a Python string. */ + +static PyObject * +Tkapp_UnicodeResult(TkappObject *self) +{ + return unicodeFromTclObj(Tcl_GetObjResult(self->interp)); +} + + /* Convert the results of a command call into a Python objects. */ -static PyObject* -Tkapp_CallResult(TkappObject *self) +static PyObject * +Tkapp_ObjectResult(TkappObject *self) { PyObject *res = NULL; Tcl_Obj *value = Tcl_GetObjResult(self->interp); - if(self->wantobjects) { + if (self->wantobjects) { /* Not sure whether the IncrRef is necessary, but something may overwrite the interpreter result while we are converting it. */ Tcl_IncrRefCount(value); - res = FromObj((PyObject*)self, value); + res = FromObj(self, value); Tcl_DecrRefCount(value); } else { res = unicodeFromTclObj(value); @@ -1412,15 +1451,13 @@ i = Tcl_EvalObjv(e->self->interp, objc, objv, e->flags); ENTER_PYTHON if (i == TCL_ERROR) { - *(e->res) = NULL; - *(e->exc_type) = NULL; - *(e->exc_tb) = NULL; - *(e->exc_value) = PyObject_CallFunction( - Tkinter_TclError, "s", - Tcl_GetStringResult(e->self->interp)); + *(e->res) = Tkinter_Error(e->self); } else { - *(e->res) = Tkapp_CallResult(e->self); + *(e->res) = Tkapp_ObjectResult(e->self); + } + if (*(e->res) == NULL) { + PyErr_Fetch(e->exc_type, e->exc_value, e->exc_tb); } LEAVE_PYTHON @@ -1508,9 +1545,9 @@ ENTER_OVERLAP if (i == TCL_ERROR) - Tkinter_Error(selfptr); + Tkinter_Error(self); else - res = Tkapp_CallResult(self); + res = Tkapp_ObjectResult(self); LEAVE_OVERLAP_TCL @@ -1542,9 +1579,9 @@ err = Tcl_Eval(Tkapp_Interp(self), script); ENTER_OVERLAP if (err == TCL_ERROR) - res = Tkinter_Error((PyObject *)self); + res = Tkinter_Error(self); else - res = unicodeFromTclString(Tkapp_Result(self)); + res = Tkapp_UnicodeResult(self); LEAVE_OVERLAP_TCL return res; } @@ -1571,9 +1608,9 @@ err = Tcl_EvalFile(Tkapp_Interp(self), fileName); ENTER_OVERLAP if (err == TCL_ERROR) - res = Tkinter_Error((PyObject *)self); + res = Tkinter_Error(self); else - res = unicodeFromTclString(Tkapp_Result(self)); + res = Tkapp_UnicodeResult(self); LEAVE_OVERLAP_TCL return res; } @@ -1600,9 +1637,9 @@ err = Tcl_RecordAndEval(Tkapp_Interp(self), script, TCL_NO_EVAL); ENTER_OVERLAP if (err == TCL_ERROR) - res = Tkinter_Error((PyObject *)self); + res = Tkinter_Error(self); else - res = unicodeFromTclString(Tkapp_Result(self)); + res = Tkapp_UnicodeResult(self); LEAVE_OVERLAP_TCL return res; } @@ -1633,13 +1670,13 @@ /** Tcl Variable **/ -typedef PyObject* (*EventFunc)(PyObject*, PyObject *args, int flags); +typedef PyObject* (*EventFunc)(TkappObject *, PyObject *, int); TCL_DECLARE_MUTEX(var_mutex) typedef struct VarEvent { Tcl_Event ev; /* must be first */ - PyObject *self; + TkappObject *self; PyObject *args; int flags; EventFunc func; @@ -1694,7 +1731,7 @@ return 1; } if (PyTclObject_Check(in)) { - *out = PyTclObject_TclString(in); + *out = Tcl_GetString(((PyTclObject *)in)->value); return 1; } PyErr_Format(PyExc_TypeError, @@ -1752,7 +1789,7 @@ PyErr_NoMemory(); return NULL; } - ev->self = selfptr; + ev->self = self; ev->args = args; ev->flags = flags; ev->func = func; @@ -1772,11 +1809,11 @@ return res; } /* Tcl is not threaded, or this is the interpreter thread. */ - return func(selfptr, args, flags); + return func(self, args, flags); } static PyObject * -SetVar(PyObject *self, PyObject *args, int flags) +SetVar(TkappObject *self, PyObject *args, int flags) { const char *name1, *name2; PyObject *newValue; @@ -1845,7 +1882,7 @@ static PyObject * -GetVar(PyObject *self, PyObject *args, int flags) +GetVar(TkappObject *self, PyObject *args, int flags) { const char *name1, *name2=NULL; PyObject *res = NULL; @@ -1860,10 +1897,9 @@ tres = Tcl_GetVar2Ex(Tkapp_Interp(self), name1, name2, flags); ENTER_OVERLAP if (tres == NULL) { - PyErr_SetString(Tkinter_TclError, - Tcl_GetStringResult(Tkapp_Interp(self))); + Tkinter_Error(self); } else { - if (((TkappObject*)self)->wantobjects) { + if (self->wantobjects) { res = FromObj(self, tres); } else { @@ -1889,7 +1925,7 @@ static PyObject * -UnsetVar(PyObject *self, PyObject *args, int flags) +UnsetVar(TkappObject *self, PyObject *args, int flags) { char *name1, *name2=NULL; int code; @@ -1961,7 +1997,7 @@ CHECK_STRING_LENGTH(s); value = Tcl_NewStringObj(s, -1); if (value == NULL) - return Tkinter_Error((PyObject *)self); + return Tkinter_Error(self); } /* Don't use Tcl_GetInt() because it returns ambiguous result for value in ranges -2**32..-2**31-1 and 2**31..2**32-1 (on 32-bit platform). @@ -1970,14 +2006,14 @@ value in ranges -2**64..-2**63-1 and 2**63..2**64-1 (on 32-bit platform). */ #ifdef HAVE_LIBTOMMAMTH - result = fromBignumObj((PyObject *)self, value); + result = fromBignumObj(self, value); #else - result = fromWideIntObj((PyObject *)self, value); + result = fromWideIntObj(self, value); #endif Tcl_DecrRefCount(value); if (result != NULL || PyErr_Occurred()) return result; - return Tkinter_Error((PyObject *)self); + return Tkinter_Error(self); } /*[clinic input] @@ -2008,7 +2044,7 @@ if (Tcl_GetDoubleFromObj(Tkapp_Interp(self), ((PyTclObject*)arg)->value, &v) == TCL_ERROR) - return Tkinter_Error((PyObject *)self); + return Tkinter_Error(self); return PyFloat_FromDouble(v); } @@ -2016,7 +2052,7 @@ return NULL; CHECK_STRING_LENGTH(s); if (Tcl_GetDouble(Tkapp_Interp(self), s, &v) == TCL_ERROR) - return Tkinter_Error((PyObject *)self); + return Tkinter_Error(self); return PyFloat_FromDouble(v); } @@ -2043,7 +2079,7 @@ if (Tcl_GetBooleanFromObj(Tkapp_Interp(self), ((PyTclObject*)arg)->value, &v) == TCL_ERROR) - return Tkinter_Error((PyObject *)self); + return Tkinter_Error(self); return PyBool_FromLong(v); } @@ -2051,7 +2087,7 @@ return NULL; CHECK_STRING_LENGTH(s); if (Tcl_GetBoolean(Tkapp_Interp(self), s, &v) == TCL_ERROR) - return Tkinter_Error((PyObject *)self); + return Tkinter_Error(self); return PyBool_FromLong(v); } @@ -2077,9 +2113,9 @@ retval = Tcl_ExprString(Tkapp_Interp(self), s); ENTER_OVERLAP if (retval == TCL_ERROR) - res = Tkinter_Error((PyObject *)self); + res = Tkinter_Error(self); else - res = unicodeFromTclString(Tkapp_Result(self)); + res = Tkapp_UnicodeResult(self); LEAVE_OVERLAP_TCL return res; } @@ -2107,7 +2143,7 @@ retval = Tcl_ExprLong(Tkapp_Interp(self), s, &v); ENTER_OVERLAP if (retval == TCL_ERROR) - res = Tkinter_Error((PyObject *)self); + res = Tkinter_Error(self); else res = PyLong_FromLong(v); LEAVE_OVERLAP_TCL @@ -2138,7 +2174,7 @@ ENTER_OVERLAP PyFPE_END_PROTECT(retval) if (retval == TCL_ERROR) - res = Tkinter_Error((PyObject *)self); + res = Tkinter_Error(self); else res = PyFloat_FromDouble(v); LEAVE_OVERLAP_TCL @@ -2167,7 +2203,7 @@ retval = Tcl_ExprBoolean(Tkapp_Interp(self), s, &v); ENTER_OVERLAP if (retval == TCL_ERROR) - res = Tkinter_Error((PyObject *)self); + res = Tkinter_Error(self); else res = PyLong_FromLong(v); LEAVE_OVERLAP_TCL @@ -2200,12 +2236,12 @@ if (Tcl_ListObjGetElements(Tkapp_Interp(self), ((PyTclObject*)arg)->value, &objc, &objv) == TCL_ERROR) { - return Tkinter_Error((PyObject *)self); + return Tkinter_Error(self); } if (!(v = PyTuple_New(objc))) return NULL; for (i = 0; i < objc; i++) { - PyObject *s = FromObj((PyObject*)self, objv[i]); + PyObject *s = FromObj(self, objv[i]); if (!s) { Py_DECREF(v); return NULL; @@ -2233,7 +2269,7 @@ if (Tcl_SplitList(Tkapp_Interp(self), list, &argc, &argv) == TCL_ERROR) { PyMem_Free(list); - return Tkinter_Error((PyObject *)self); + return Tkinter_Error(self); } if (!(v = PyTuple_New(argc))) @@ -2277,16 +2313,16 @@ int i; if (Tcl_ListObjGetElements(Tkapp_Interp(self), value, &objc, &objv) == TCL_ERROR) { - return FromObj((PyObject*)self, value); + return FromObj(self, value); } if (objc == 0) return PyUnicode_FromString(""); if (objc == 1) - return FromObj((PyObject*)self, objv[0]); + return FromObj(self, objv[0]); if (!(v = PyTuple_New(objc))) return NULL; for (i = 0; i < objc; i++) { - PyObject *s = FromObj((PyObject*)self, objv[i]); + PyObject *s = FromObj(self, objv[i]); if (!s) { Py_DECREF(v); return NULL; @@ -2333,34 +2369,31 @@ * function or method. */ static int -PythonCmd(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]) +PythonCmd(ClientData clientData, Tcl_Interp *interp, + int objc, Tcl_Obj *const objv[]) { PythonCmd_ClientData *data = (PythonCmd_ClientData *)clientData; - PyObject *func, *arg, *res; - int i, rv; + PyObject *args, *res; + int i; Tcl_Obj *obj_res; ENTER_PYTHON - /* TBD: no error checking here since we know, via the - * Tkapp_CreateCommand() that the client data is a two-tuple - */ - func = data->func; - - /* Create argument list (argv1, ..., argvN) */ - if (!(arg = PyTuple_New(argc - 1))) + /* Create argument tuple (objv1, ..., objvN) */ + if (!(args = PyTuple_New(objc - 1))) return PythonCmd_Error(interp); - for (i = 0; i < (argc - 1); i++) { - PyObject *s = unicodeFromTclString(argv[i + 1]); + for (i = 0; i < (objc - 1); i++) { + PyObject *s = unicodeFromTclObj(objv[i + 1]); if (!s) { - Py_DECREF(arg); + Py_DECREF(args); return PythonCmd_Error(interp); } - PyTuple_SET_ITEM(arg, i, s); + PyTuple_SET_ITEM(args, i, s); } - res = PyObject_Call(func, arg, NULL); - Py_DECREF(arg); + + res = PyObject_Call(data->func, args, NULL); + Py_DECREF(args); if (res == NULL) return PythonCmd_Error(interp); @@ -2370,18 +2403,15 @@ Py_DECREF(res); return PythonCmd_Error(interp); } - else { - Tcl_SetObjResult(interp, obj_res); - rv = TCL_OK; - } - + Tcl_SetObjResult(interp, obj_res); Py_DECREF(res); LEAVE_PYTHON - return rv; + return TCL_OK; } + static void PythonCmdDelete(ClientData clientData) { @@ -2413,7 +2443,7 @@ Tkapp_CommandProc(CommandEvent *ev, int flags) { if (ev->create) - *ev->status = Tcl_CreateCommand( + *ev->status = Tcl_CreateObjCommand( ev->interp, ev->name, PythonCmd, ev->data, PythonCmdDelete) == NULL; else @@ -2479,7 +2509,7 @@ else { ENTER_TCL - err = Tcl_CreateCommand( + err = Tcl_CreateObjCommand( Tkapp_Interp(self), name, PythonCmd, (ClientData)data, PythonCmdDelete) == NULL; LEAVE_TCL @@ -2956,9 +2986,9 @@ if (err == TCL_ERROR) { /* This sets an exception, but we cannot return right away because we need to exit the overlap first. */ - Tkinter_Error((PyObject *)self); + Tkinter_Error(self); } else { - _tk_exists = Tkapp_Result(self); + _tk_exists = Tcl_GetStringResult(Tkapp_Interp(self)); } LEAVE_OVERLAP_TCL if (err == TCL_ERROR) { @@ -2966,8 +2996,7 @@ } if (_tk_exists == NULL || strcmp(_tk_exists, "1") != 0) { if (Tk_Init(interp) == TCL_ERROR) { - PyErr_SetString(Tkinter_TclError, - Tcl_GetStringResult(Tkapp_Interp(self))); + Tkinter_Error(self); #ifdef TKINTER_PROTECT_LOADTK tk_load_failed = 1; #endif @@ -3523,11 +3552,13 @@ if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) { str_path = _get_tcl_lib_path(); if (str_path == NULL && PyErr_Occurred()) { + Py_DECREF(m); return NULL; } if (str_path != NULL) { wcs_path = PyUnicode_AsWideCharString(str_path, NULL); if (wcs_path == NULL) { + Py_DECREF(m); return NULL; } SetEnvironmentVariableW(L"TCL_LIBRARY", wcs_path); diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/distutils/command/build_ext.py python3-stdlib-extensions-3.8.2/3.8/Lib/distutils/command/build_ext.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/distutils/command/build_ext.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/distutils/command/build_ext.py 2020-02-24 21:36:25.000000000 +0000 @@ -688,7 +688,15 @@ provided, "PyInit_" + module_name. Only relevant on Windows, where the .pyd file (DLL) must export the module "PyInit_" function. """ - initfunc_name = "PyInit_" + ext.name.split('.')[-1] + suffix = '_' + ext.name.split('.')[-1] + try: + # Unicode module name support as defined in PEP-489 + # https://www.python.org/dev/peps/pep-0489/#export-hook-name + suffix.encode('ascii') + except UnicodeEncodeError: + suffix = 'U' + suffix.encode('punycode').replace(b'-', b'_').decode('ascii') + + initfunc_name = "PyInit" + suffix if initfunc_name not in ext.export_symbols: ext.export_symbols.append(initfunc_name) return ext.export_symbols diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/distutils/tests/test_build_ext.py python3-stdlib-extensions-3.8.2/3.8/Lib/distutils/tests/test_build_ext.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/distutils/tests/test_build_ext.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/distutils/tests/test_build_ext.py 2020-02-24 21:36:25.000000000 +0000 @@ -304,6 +304,19 @@ cmd.ensure_finalized() self.assertEqual(cmd.get_source_files(), ['xxx']) + def test_unicode_module_names(self): + modules = [ + Extension('foo', ['aaa'], optional=False), + Extension('föö', ['uuu'], optional=False), + ] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = self.build_ext(dist) + cmd.ensure_finalized() + self.assertRegex(cmd.get_ext_filename(modules[0].name), r'foo(_d)?\..*') + self.assertRegex(cmd.get_ext_filename(modules[1].name), r'föö(_d)?\..*') + self.assertEqual(cmd.get_export_symbols(modules[0]), ['PyInit_foo']) + self.assertEqual(cmd.get_export_symbols(modules[1]), ['PyInitU_f_gkaa']) + def test_compiler_option(self): # cmd.compiler is an option and # should not be overridden by a compiler instance diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/fixes/fix_apply.py python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/fixes/fix_apply.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/fixes/fix_apply.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/fixes/fix_apply.py 2020-02-24 21:36:25.000000000 +0000 @@ -37,10 +37,8 @@ # I feel like we should be able to express this logic in the # PATTERN above but I don't know how to do it so... if args: - if args.type == self.syms.star_expr: - return # Make no change. if (args.type == self.syms.argument and - args.children[0].value == '**'): + args.children[0].value in {'**', '*'}): return # Make no change. if kwds and (kwds.type == self.syms.argument and kwds.children[0].value == '**'): diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/fixes/fix_filter.py python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/fixes/fix_filter.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/fixes/fix_filter.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/fixes/fix_filter.py 2020-02-24 21:36:25.000000000 +0000 @@ -17,7 +17,7 @@ from .. import fixer_base from ..pytree import Node from ..pygram import python_symbols as syms -from ..fixer_util import Name, ArgList, ListComp, in_special_context +from ..fixer_util import Name, ArgList, ListComp, in_special_context, parenthesize class FixFilter(fixer_base.ConditionalFix): @@ -65,10 +65,14 @@ trailers.append(t.clone()) if "filter_lambda" in results: + xp = results.get("xp").clone() + if xp.type == syms.test: + xp.prefix = "" + xp = parenthesize(xp) + new = ListComp(results.get("fp").clone(), results.get("fp").clone(), - results.get("it").clone(), - results.get("xp").clone()) + results.get("it").clone(), xp) new = Node(syms.power, [new] + trailers, prefix="") elif "none" in results: diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/fixes/fix_intern.py python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/fixes/fix_intern.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/fixes/fix_intern.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/fixes/fix_intern.py 2020-02-24 21:36:25.000000000 +0000 @@ -30,10 +30,8 @@ # PATTERN above but I don't know how to do it so... obj = results['obj'] if obj: - if obj.type == self.syms.star_expr: - return # Make no change. if (obj.type == self.syms.argument and - obj.children[0].value == '**'): + obj.children[0].value in {'**', '*'}): return # Make no change. names = ('sys', 'intern') new = ImportAndCall(node, results, names) diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/fixes/fix_reload.py python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/fixes/fix_reload.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/fixes/fix_reload.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/fixes/fix_reload.py 2020-02-24 21:36:25.000000000 +0000 @@ -27,10 +27,8 @@ # PATTERN above but I don't know how to do it so... obj = results['obj'] if obj: - if obj.type == self.syms.star_expr: - return # Make no change. if (obj.type == self.syms.argument and - obj.children[0].value == '**'): + obj.children[0].value in {'**', '*'}): return # Make no change. names = ('importlib', 'reload') new = ImportAndCall(node, results, names) diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/Grammar.txt python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/Grammar.txt --- python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/Grammar.txt 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/Grammar.txt 2020-02-24 21:36:25.000000000 +0000 @@ -138,8 +138,8 @@ # that precede iterable unpackings are blocked; etc. argument: ( test [comp_for] | test '=' test | - '**' expr | - star_expr ) + '**' test | + '*' test ) comp_iter: comp_for | comp_if comp_for: [ASYNC] 'for' exprlist 'in' testlist_safe [comp_iter] diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/tests/test_fixers.py python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/tests/test_fixers.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/tests/test_fixers.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/tests/test_fixers.py 2020-02-24 21:36:25.000000000 +0000 @@ -2954,6 +2954,11 @@ a = """x = [x for x in range(10) if x%2 == 0]""" self.check(b, a) + # bpo-38871 + b = """filter(lambda x: True if x > 2 else False, [1, 2, 3])""" + a = """[x for x in [1, 2, 3] if (True if x > 2 else False)]""" + self.check(b, a) + def test_filter_trailers(self): b = """x = filter(None, 'abc')[0]""" a = """x = [_f for _f in 'abc' if _f][0]""" diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/tests/test_parser.py python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/tests/test_parser.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/lib2to3/tests/test_parser.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/lib2to3/tests/test_parser.py 2020-02-24 21:36:25.000000000 +0000 @@ -253,6 +253,13 @@ def test_double_star_dict_literal_after_keywords(self): self.validate("""func(spam='fried', **{'eggs':'scrambled'})""") + def test_double_star_expression(self): + self.validate("""func(**{'a':2} or {})""") + self.validate("""func(**() or {})""") + + def test_star_expression(self): + self.validate("""func(*[] or [2])""") + def test_list_display(self): self.validate("""[*{2}, 3, *[4]]""") diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/tkinter/__init__.py python3-stdlib-extensions-3.8.2/3.8/Lib/tkinter/__init__.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/tkinter/__init__.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/tkinter/__init__.py 2020-02-24 21:36:25.000000000 +0000 @@ -1051,7 +1051,7 @@ return self.tk.call('winfo', 'class', self._w) def winfo_colormapfull(self): - """Return true if at the last color request the colormap was full.""" + """Return True if at the last color request the colormap was full.""" return self.tk.getboolean( self.tk.call('winfo', 'colormapfull', self._w)) @@ -3224,7 +3224,7 @@ select_clear = selection_clear def selection_includes(self, index): - """Return 1 if INDEX is part of the selection.""" + """Return True if INDEX is part of the selection.""" return self.tk.getboolean(self.tk.call( self._w, 'selection', 'includes', index)) diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/tkinter/test/widget_tests.py python3-stdlib-extensions-3.8.2/3.8/Lib/tkinter/test/widget_tests.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/tkinter/test/widget_tests.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/tkinter/test/widget_tests.py 2020-02-24 21:36:25.000000000 +0000 @@ -3,7 +3,6 @@ import unittest import sys import tkinter -from tkinter.ttk import Scale from tkinter.test.support import (AbstractTkTest, tcl_version, requires_tcl, get_tk_patchlevel, pixels_conv, tcl_obj_eq) import test.support @@ -63,11 +62,9 @@ eq = tcl_obj_eq self.assertEqual2(widget[name], expected, eq=eq) self.assertEqual2(widget.cget(name), expected, eq=eq) - # XXX - if not isinstance(widget, Scale): - t = widget.configure(name) - self.assertEqual(len(t), 5) - self.assertEqual2(t[4], expected, eq=eq) + t = widget.configure(name) + self.assertEqual(len(t), 5) + self.assertEqual2(t[4], expected, eq=eq) def checkInvalidParam(self, widget, name, value, errmsg=None, *, keep_orig=True): @@ -209,9 +206,7 @@ def test_keys(self): widget = self.create() keys = widget.keys() - # XXX - if not isinstance(widget, Scale): - self.assertEqual(sorted(keys), sorted(widget.configure())) + self.assertEqual(sorted(keys), sorted(widget.configure())) for k in keys: widget[k] # Test if OPTIONS contains all keys diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/tkinter/tix.py python3-stdlib-extensions-3.8.2/3.8/Lib/tkinter/tix.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/tkinter/tix.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/tkinter/tix.py 2020-02-24 21:36:25.000000000 +0000 @@ -1890,7 +1890,7 @@ containing the current size setting of the given column. When option-value pairs are given, the corresponding options of the size setting of the given column are changed. Options may be one - of the follwing: + of the following: pad0 pixels Specifies the paddings to the left of a column. pad1 pixels @@ -1915,7 +1915,7 @@ When no option-value pair is given, this command returns a list con- taining the current size setting of the given row . When option-value pairs are given, the corresponding options of the size setting of the - given row are changed. Options may be one of the follwing: + given row are changed. Options may be one of the following: pad0 pixels Specifies the paddings to the top of a row. pad1 pixels diff -Nru python3-stdlib-extensions-3.8.0/3.8/Lib/tkinter/ttk.py python3-stdlib-extensions-3.8.2/3.8/Lib/tkinter/ttk.py --- python3-stdlib-extensions-3.8.0/3.8/Lib/tkinter/ttk.py 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Lib/tkinter/ttk.py 2020-02-24 21:36:25.000000000 +0000 @@ -1084,11 +1084,12 @@ Setting a value for any of the "from", "from_" or "to" options generates a <> event.""" - if cnf: + retval = Widget.configure(self, cnf, **kw) + if not isinstance(cnf, (type(None), str)): kw.update(cnf) - Widget.configure(self, **kw) if any(['from' in kw, 'from_' in kw, 'to' in kw]): self.event_generate('<>') + return retval def get(self, x=None, y=None): diff -Nru python3-stdlib-extensions-3.8.0/3.8/Modules/_tkinter.c python3-stdlib-extensions-3.8.2/3.8/Modules/_tkinter.c --- python3-stdlib-extensions-3.8.0/3.8/Modules/_tkinter.c 2019-10-14 13:34:47.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/3.8/Modules/_tkinter.c 2020-02-24 21:36:25.000000000 +0000 @@ -3549,11 +3549,13 @@ if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) { str_path = _get_tcl_lib_path(); if (str_path == NULL && PyErr_Occurred()) { + Py_DECREF(m); return NULL; } if (str_path != NULL) { wcs_path = PyUnicode_AsWideCharString(str_path, NULL); if (wcs_path == NULL) { + Py_DECREF(m); return NULL; } SetEnvironmentVariableW(L"TCL_LIBRARY", wcs_path); diff -Nru python3-stdlib-extensions-3.8.0/debian/changelog python3-stdlib-extensions-3.8.2/debian/changelog --- python3-stdlib-extensions-3.8.0/debian/changelog 2020-02-22 08:24:22.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/debian/changelog 2020-02-28 11:35:43.000000000 +0000 @@ -1,8 +1,17 @@ -python3-stdlib-extensions (3.8.0-1ubuntu1) focal; urgency=medium +python3-stdlib-extensions (3.8.2-1ubuntu1) focal; urgency=medium - * Build for 3.8 only. + * Stop building extensions for 3.7. - -- Matthias Klose Sat, 22 Feb 2020 09:24:22 +0100 + -- Matthias Klose Fri, 28 Feb 2020 12:35:43 +0100 + +python3-stdlib-extensions (3.8.2-1) unstable; urgency=medium + + * Update 3.7 extensions and modules to 3.7.6 release. + * Update 3.8 extensions and modules to 3.8.2 release. + * Remove version information from the python3-lib2to3 package description. + Closes: #920867. + + -- Matthias Klose Fri, 28 Feb 2020 12:31:06 +0100 python3-stdlib-extensions (3.8.0-1) unstable; urgency=medium diff -Nru python3-stdlib-extensions-3.8.0/debian/control python3-stdlib-extensions-3.8.2/debian/control --- python3-stdlib-extensions-3.8.0/debian/control 2020-02-22 08:24:22.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/debian/control 2020-02-28 11:35:17.000000000 +0000 @@ -90,8 +90,8 @@ libpython3.7-stdlib (<< 3.7.0~a3-3), python3.6-2to3 (<< 3.6.4-2), python3.7-2to3 (<< 3.7.0~a3-3), -Description: Interactive high-level object-oriented language (2to3, version 3.6) - Python is a high-level, interactive, object-oriented language. Its 3.6 version +Description: Interactive high-level object-oriented language (lib2to3) + Python is a high-level, interactive, object-oriented language. It includes an extensive class library with lots of goodies for network programming, system administration, sounds and graphics. . diff -Nru python3-stdlib-extensions-3.8.0/debian/rules python3-stdlib-extensions-3.8.2/debian/rules --- python3-stdlib-extensions-3.8.0/debian/rules 2020-02-22 08:24:22.000000000 +0000 +++ python3-stdlib-extensions-3.8.2/debian/rules 2020-02-28 11:35:17.000000000 +0000 @@ -14,7 +14,6 @@ #rel_ext = $(strip $(shell dpkg-parsechangelog | awk -F- '/^Version:/ {print $$NF}')) PYVERS = $(shell py3versions -vs) -PYVERS = 3.7 3.8 PYVERS = 3.8 MIN_VER = 3.8.0-1~