[Python-3000] Pleaswe help with the countdown to zero failing tests in the struni branch!

Thomas Heller theller at ctypes.org
Thu Aug 9 19:40:12 CEST 2007


Martin v. Löwis schrieb:
>>> It's in Modules/timemodule.c, line 691:
>>>         PyModule_AddObject(m, "tzname",
>>>                            Py_BuildValue("(zz)", tzname[0], tzname[1]));
>>>
>>> According to MSDN, tzname is a global variable; the contents is somehow
>>> derived from the TZ environment variable (which is not set in my case).
>> 
>> Is there anything from which you can guess the encoding (e.g. the
>> filesystem encoding?).
> 
> It's in the locale's encoding. On Windows, that will be "mbcs"; on other
> systems, the timezone names are typically all in ASCII - this would
> allow for a quick work-around. Using the filesytemencoding would also
> work, although it would be an equal hack: it's *meant* to be used only
> for file names (and on OSX at least, it deviates from the locale's
> encoding - although I have no idea what tzname is encoded in on OSX).
> 
>> These are all externally-provided strings. It will depend on the
>> platform what the encoding is.
>> 
>> I wonder if we need to add another format code to Py_BuildValue (and
>> its friends) to designate "platform default encoding" instead of
>> UTF-8.
> 
> For symmetry with ParseTuple, there could be the 'e' versions
> (es, ez, ...) which would take a codec name also.

That would be great, imo. OTOH, I have not time to do this.
Currently, I have to set TZ=GMT to be able to start python 3.

Thomas



More information about the Python-3000 mailing list