[Python-3000] Unicode strings, identifiers, and import
Guido van Rossum
guido at python.org
Fri May 18 01:22:11 CEST 2007
On 5/17/07, Giovanni Bajo <rasky at develer.com> wrote:
> On 18/05/2007 1.10, Guido van Rossum wrote:
> >> In fact, I have a question about this. Can anybody show me a valid
> >> multi-platform Python code snippet that, given a filename as *unicode*
> >> string,
> >> create a file with that name, possibly adjusting the name so to ignore an
> >> encoding problem (so that the function *always* succeed)?
> >> def dump_to_file(unicode_filename):
> >> ...
> >> I attempted this a couple of times without being satisfied at all by the
> >> solutions.
> > Why does it have to be cross-platform? The mapping from module names
> > to the filesystem is considered platform specific.
> With cross-platform, I meant a snippet of code which worked on all platform.
> The canonicalization of the filename that is produced could of course be
> different on each plaform.
And I meant what I said. The algorithm is up to the Python
implementation on a specific platform. This means that we will have to
decide what it will be. Feel free to contribute a suggestion to the
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000