]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Convert path objects to strings in askdirectory. Fixes #852314.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 1 Dec 2003 21:04:22 +0000 (21:04 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 1 Dec 2003 21:04:22 +0000 (21:04 +0000)
Backported to 2.3.

Lib/lib-tk/tkFileDialog.py

index 8419718acbc26e225f8f0f50f2a99b938e82870f..c2c661cbad5e59d7bfb50b88104384d2f0d33846 100644 (file)
@@ -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