[issue20035] Clean up Tcl library discovery in Tkinter on Windows

Serhiy Storchaka report at bugs.python.org
Wed May 21 17:59:29 CEST 2014


Serhiy Storchaka added the comment:

I want to get this too, but perhaps there are some issues in a code.

1. Py_GetPrefix() returns wchar_t* string with maximal length MAXPATHLEN (defined in Include/osdefs.h as 256 on Windows). Then wcstombs() converts it to char* string. Are you sure that MAX_PATH (defined as 260 on Windows) is enough for converted string? I afraid that for multi-byte encoding it can be 2*MAXPATHLEN or even 3*MAXPATHLEN bytes.

2. After converting _tcl_library contains a path in locale encoding. And _putenv() works with it. I'm not sure, but I afraid that Tcl_SetVar() can expect UTF-8 encoded string. Please test with prefix containing non-ASCII characters (or even better with prefix containing East-Asian characters on East-Asian Windows).

----------
nosy: +haypo, scoder

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20035>
_______________________________________


More information about the Python-bugs-list mailing list