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/107541.html below:

[Python-Dev] Import and unicode: part two

[Python-Dev] Import and unicode: part two [Python-Dev] Import and unicode: part twoAlexander Belopolsky alexander.belopolsky at gmail.com
Thu Jan 20 19:02:28 CET 2011
On Thu, Jan 20, 2011 at 11:45 AM, Andy Teijelo <ateijelo at gmail.com> wrote:
..
> but if the code said:
>
> import café
>
> then Python would look, in any platform, for a file named:
>
> caf&eacute;.py  or  caf&#233;.py  or something nicer.
>
> Something along the lines of xmlcharrefreplace.
> Just an idea.

Curiously, something like this already happens on OSX when filename is
not valid UTF-8.  For example,

>>> open(b'\xdb\xcd', 'w').close()
>>> open(b'\xdb\xcd')
<_io.TextIOWrapper name=b'\xdb\xcd' mode='r' encoding='UTF-8'>

but the actual file created is named "%DB%CD".  (Looks like URL-encoding).
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