summaryrefslogtreecommitdiffstats
path: root/Lib/lib-tk
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-01-04 00:08:09 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-01-04 00:08:09 (GMT)
commit25c7b50e8f5c8bcdda6631a5d3042eb3ae460b2c (patch)
tree78f27fe05109377ac44a1a0d5c400542bc9b4180 /Lib/lib-tk
parent77023048854bc408308a10dc092bbd216f9da45e (diff)
downloadcpython-25c7b50e8f5c8bcdda6631a5d3042eb3ae460b2c.zip
cpython-25c7b50e8f5c8bcdda6631a5d3042eb3ae460b2c.tar.gz
cpython-25c7b50e8f5c8bcdda6631a5d3042eb3ae460b2c.tar.bz2
Convert Tcl path objects to strings. Fixes #661357.
Provide .string attribute and __unicode for Tcl_Objs.
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r--Lib/lib-tk/tkFileDialog.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/lib-tk/tkFileDialog.py b/Lib/lib-tk/tkFileDialog.py
index 569254a..63487d2 100644
--- a/Lib/lib-tk/tkFileDialog.py
+++ b/Lib/lib-tk/tkFileDialog.py
@@ -55,6 +55,12 @@ class _Dialog(Dialog):
if result:
# keep directory and filename until next time
import os
+ # convert Tcl path objects to strings
+ try:
+ result = result.string
+ except AttributeError:
+ # it already is a string
+ pass
path, file = os.path.split(result)
self.options["initialdir"] = path
self.options["initialfile"] = file