diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2003-12-01 21:04:22 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2003-12-01 21:04:22 (GMT) |
commit | 85f48e3b9b071150623d9f1af56d7665acd6d225 (patch) | |
tree | fc3fb1d2dbb94f405dd76b0285a16271914aa105 /Lib | |
parent | 3375fc5a3b3a6f53fff446bfb28147fba4cc2e3a (diff) | |
download | cpython-85f48e3b9b071150623d9f1af56d7665acd6d225.zip cpython-85f48e3b9b071150623d9f1af56d7665acd6d225.tar.gz cpython-85f48e3b9b071150623d9f1af56d7665acd6d225.tar.bz2 |
Convert path objects to strings in askdirectory. Fixes #852314.
Backported to 2.3.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/lib-tk/tkFileDialog.py | 6 |
1 files changed, 6 insertions, 0 deletions
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 |