[Python-ideas] Introduce some obvious way to encode and decode filenames from Python code

Sven Marnach sven at marnach.net
Wed Jul 18 12:36:54 CEST 2012


MRAB schrieb am Tue, 17. Jul 2012, um 22:52:57 +0100:
> On 17/07/2012 22:25, Sven Marnach wrote:
> >Victor Stinner schrieb am Tue, 17. Jul 2012, um 03:03:24 +0200:
> >>os.fsencode() should not be used explicitly on Windows.
> >
> >What else should I do to pipe filenames to another process?  At least,
> >os.fsencode() seems to work, even with cyrillic filenames.
> >
> Encode to UTF-8?

I don't have control over the other process (it's ExifTool in batch
mode), so I have to use whatever encoding is considered the standard
to encode filenames on Windows.  `os.fsencode()` works fine for this,
and Victor answered off-list that it would be fine in this case.

Cheers,
    Sven



More information about the Python-ideas mailing list