This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients Arfrever, eric.araujo, lemburg, pitrou, vstinner
Date 2010-08-27.20:08:55
SpamBayes Score 0.0
Marked as misclassified No
Message-id <4C781B56.2070705@egenix.com>
In-reply-to <1282931334.3264.1.camel@localhost.localdomain>
Content
Antoine Pitrou wrote:
> 
> Antoine Pitrou <pitrou@free.fr> added the comment:
> 
>>>> Think of e.g. embedded Python interpreters or py2exe-style applications
>>>> running on Linux or other systems that don't use Unicode APIs 
>>>> for FS-interaction or have fixed FS-encodings.
>>>
>>> What is the problem here? Python does guess the filesystem encoding. If the encoding is "wrong" (not the value expected by the user), filenames are not displayed correctly (mojibake) but it does just work. Anyway, why is it not possible to use PYTHONFSENCODING here? Are you talking to Python modules loaded from a non-ascii path?
>>>
>>> Sorry, but I do not understand.
>>
>> In such environments you cannot expect the user to configure the
>> system properly (i.e. set an environment variable). Instead, the
>> application has to provide an educated guess to the Python
>> interpreter in some way, hence the idea to use a configuration
>> file or perhaps provide a C API that can be used to set the
>> variable before initializing the interpreter.
> 
> Why wouldn't the embedding application just set the environment var
> before initializing the Python interpreter?

Because that's not easy to do in a platform independent way.
OTOH, it's very easy to do via a C API function in Python and
since this env var is essential for the operation of Python,
adding such an API is warranted.
History
Date User Action Args
2010-08-27 20:08:57lemburgsetrecipients: + lemburg, pitrou, vstinner, eric.araujo, Arfrever
2010-08-27 20:08:55lemburglinkissue9632 messages
2010-08-27 20:08:55lemburgcreate