diff options
| author | Martin v. Löwis <martin@v.loewis.de> | 2003-12-01 21:04:22 +0000 |
|---|---|---|
| committer | Martin v. Löwis <martin@v.loewis.de> | 2003-12-01 21:04:22 +0000 |
| commit | 8688eeb9b29369e4b59cd76e31b9835616fdc7c7 (patch) | |
| tree | d21326222f47c6669a04033b88ffd93f7b735852 /Lib/lib-tk/tkFileDialog.py | |
| parent | 5202fb94d9ecfd9821a9661b47ab0738ae743726 (diff) | |
| download | cpython-8688eeb9b29369e4b59cd76e31b9835616fdc7c7.tar.gz | |
Convert path objects to strings in askdirectory. Fixes #852314.
Backported to 2.3.
Diffstat (limited to 'Lib/lib-tk/tkFileDialog.py')
| -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 8419718acb..c2c661cbad 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 |
