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

[Python-Dev] PEP 393 Summer of Code Project

[Python-Dev] PEP 393 Summer of Code ProjectGuido van Rossum guido at python.org
Fri Aug 26 02:34:44 CEST 2011
On Thu, Aug 25, 2011 at 2:39 AM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> If our process is working with an external process (the OS's file
> system driver) whose definition includes the statement that "File
> names are sequences of Unicode characters",

Does any OS actually say that? Don't they usually say "in a specific
normal form" or "they're just bytes"?

> then C6 says our process
> must compare canonically equivalent sequences that it takes to be file
> names as the same, whether or not they are in the same normalized
> form, or normalized at all, because we can't assume the file system
> will treat them as different.  If we do treat them as different, our
> users will get very upset (eg, if we don't signal a duplicate file
> name input by the user, and then the OS proceeds to overwrite an
> existing file).

The solution here is to let the OS do the check, e.g. with
os.path.exists() or os.stat(). It would be wrong to write an app that
checked for file existence by doing naive lookups in os.listdir()
output.

-- 
--Guido van Rossum (python.org/~guido)
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