[Python-Dev] Unicode strings as filenames

Martin v. Loewis martin@v.loewis.de
Sun, 6 Jan 2002 23:47:45 +0100


> Well, I only know about the Mac and (to a lesser extent) about
> Windows, but there's lots of methods that are not in
> {posix,mac,nt}module.c there that want filenames. And I think mmap
> also uses filenames, no? All in all I'm in favor of a single place
> where file name encoding magic is handled.

I think Marc not only things about encoding, he also wants that the
single place actually performs the system calls. So if you want to
support mmap, or an additional system call that expects or returns a
file name, you cannot put it into your module; instead, you must put
it in fileapi.c first, and *then* call the function in fileapi.c from
your module.

It may be necessary to call different routines depending on whether
you have a byte or a character string; this is not something a getargs
converter can do. It also may be that, depending on which system
routine you call, the system will *return* either wide or narrow
strings to you. Every time you find another use of file names, Marc
suggests you put that into fileapi.c.

Regards,
Martin