summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-04-05 20:41:37 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-04-05 20:41:37 (GMT)
commit790465fd90e8a72590386465f518db9e67ab843f (patch)
tree62e3e47f6f97120dfdfc94a87dc1a06414d95a13 /Modules/_tkinter.c
parentb9279bc88f867d9d3b6606502a678b137329b54d (diff)
downloadcpython-790465fd90e8a72590386465f518db9e67ab843f.zip
cpython-790465fd90e8a72590386465f518db9e67ab843f.tar.gz
cpython-790465fd90e8a72590386465f518db9e67ab843f.tar.bz2
Change command line processing API to use wchar_t.
Fixes #2128.
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index d45e2d4..33efaff 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -3012,7 +3012,7 @@ ins_string(PyObject *d, char *name, char *val)
PyMODINIT_FUNC
init_tkinter(void)
{
- PyObject *m, *d;
+ PyObject *m, *d, *uexe, *cexe;
Py_TYPE(&Tkapp_Type) = &PyType_Type;
@@ -3065,7 +3065,16 @@ init_tkinter(void)
/* This helps the dynamic loader; in Unicode aware Tcl versions
it also helps Tcl find its encodings. */
- Tcl_FindExecutable(Py_GetProgramName());
+ uexe = PyUnicode_FromWideChar(Py_GetProgramName(), -1);
+ if (uexe) {
+ cexe = PyUnicode_AsEncodedString(uexe,
+ Py_FileSystemDefaultEncoding,
+ NULL);
+ if (cexe)
+ Tcl_FindExecutable(PyString_AsString(cexe));
+ Py_XDECREF(cexe);
+ Py_DECREF(uexe);
+ }
if (PyErr_Occurred())
return;