From: Martin v. Löwis Date: Mon, 1 Dec 2003 21:04:22 +0000 (+0000) Subject: Convert path objects to strings in askdirectory. Fixes #852314. X-Git-Tag: v2.4a1~1180 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85f48e3b9b071150623d9f1af56d7665acd6d225;p=thirdparty%2FPython%2Fcpython.git Convert path objects to strings in askdirectory. Fixes #852314. Backported to 2.3. --- 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