A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-January/107511.html below:

[Python-Dev] Import and unicode: part two

[Python-Dev] Import and unicode: part twoVictor Stinner victor.stinner at haypocalc.com
Thu Jan 20 01:26:01 CET 2011
Le mercredi 19 janvier 2011 à 15:44 -0800, Toshio Kuratomi a écrit : 
> Additionally, many unix filesystem don't specify a filesystem encoding for
> filenames; they deal in legal and illegal bytes which could lead to
> troubles.  This problem of which encoding to use is a problem that can be
> seen on UNIX systems even now.

If the system is not correctly configured, it is not a bug in Python,
but a bug in the system config. Python relies on the locale to choose
the filesystem encoding (sys.getfilesystemencoding()). Python uses this
encoding to decode and encode all filenames.

> * Specify an encoding per platform and stick to that.

It doesn't work: on UNIX/BSD, the user chooses its own encoding and all
programs will use it.

Anyway, I don't see why it is a problem to have different encodings on
different systems. Each system can use its own encoding. The bug that
I'm trying to solve is a Python bug, not an OS bug.

> * Change import semantics to allow specifying the encoding of the module on
>   the filesystem (seems really icky).

This is a very bad idea. I introduced PYTHONFSENCODING environment
variable in Python 3.2, but then quickly removed it, because it
introduced a lot of inconsistencies.

Victor

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4