From 85f48e3b9b071150623d9f1af56d7665acd6d225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 1 Dec 2003 21:04:22 +0000 Subject: Convert path objects to strings in askdirectory. Fixes #852314. Backported to 2.3. --- Lib/lib-tk/tkFileDialog.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/lib-tk/tkFileDialog.py b/Lib/lib-tk/tkFileDialog.py index 8419718..c2c661c 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 -- cgit v0.12