diff options
author | Victor Stinner <vstinner@wyplay.com> | 2011-11-21 14:41:17 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@wyplay.com> | 2011-11-21 14:41:17 (GMT) |
commit | a697b373002b25c643fb898cf95e474446b2ee97 (patch) | |
tree | 5f5a155b1d2aa19a4c05db5a7fc488e8fd4d416e /Modules | |
parent | da29cc36aa2c7dcc3932ea1d83e261aa940ccdb4 (diff) | |
download | cpython-a697b373002b25c643fb898cf95e474446b2ee97.zip cpython-a697b373002b25c643fb898cf95e474446b2ee97.tar.gz cpython-a697b373002b25c643fb898cf95e474446b2ee97.tar.bz2 |
Another temporary hack to debug the issue #13441
Dump the wchar_t that we are going to decode and dump the locale
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_localemodule.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 236442f..6a751d6 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -73,6 +73,20 @@ str2uni(const char* s) #else assert(res1 == needed); #endif +#ifdef Py_DEBUG + { + size_t i; + printf("Decode wchar_t {"); + for (i=0; i<res1; i++) { + wchar_t ch = dest[i]; + if (i) + printf(" U+%04x", ch); + else + printf("U+%04x", ch); + } + printf("} (len=%u)\n", res1); + } +#endif res2 = PyUnicode_FromWideChar(dest, res1); if (dest != smallbuf) PyMem_Free(dest); @@ -160,12 +174,18 @@ PyLocale_setlocale(PyObject* self, PyObject* args) if (locale) { /* set locale */ +#ifdef Py_DEBUG + printf("SET LOCALE \"%s\"\n", locale); +#endif result = setlocale(category, locale); if (!result) { /* operation failed, no setting was changed */ PyErr_SetString(Error, "unsupported locale setting"); return NULL; } +#ifdef Py_DEBUG + printf("SET LOCALE -> %s\n", result); +#endif result_object = str2uni(result); if (!result_object) return NULL; |