From: Martin v. Löwis Date: Mon, 1 Dec 2003 21:04:02 +0000 (+0000) Subject: Convert path objects to strings in askdirectory. Fixes #852314. X-Git-Tag: v2.3.3c1~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f7cc0bf0ac2dfaa6d6edb868ac9eb2aebdf8821f;p=thirdparty%2FPython%2Fcpython.git Convert path objects to strings in askdirectory. Fixes #852314. --- diff --git a/Lib/lib-tk/tkFileDialog.py b/Lib/lib-tk/tkFileDialog.py index 8419718acbc2..c2c661cbad5e 100644 --- a/Lib/lib-tk/tkFileDialog.py +++ b/Lib/lib-tk/tkFileDialog.py @@ -105,6 +105,12 @@ class Directory(Dialog): def _fixresult(self, widget, result): if result: + # convert Tcl path objects to strings + try: + result = result.string + except AttributeError: + # it already is a string + pass # keep directory until next time self.options["initialdir"] = result self.directory = result # compatibility diff --git a/Misc/NEWS b/Misc/NEWS index b205a1547f50..e0d5c8453a13 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -39,6 +39,8 @@ Core and builtins Extension modules ----------------- +- Bug #852314: Fix return type of tkFileDialog.askdirectory on Unix. + - Bug #834676: Fix crashes when normalizing Hangul syllables. - Bug #703198: Ignore "b" and "t" in os.popen on Unix.