[Python-Dev] PEP 277 (unicode filenames): please review
Guido van Rossum
Tue, 13 Aug 2002 10:23:28 -0400
> There was a suggestion from David Ascher that supporting a Unicode
> version of getcwd would be useful and I agree as this will often feed into
> the other file handling calls. This one can't be finessed by checking an
> input argument for Unicode, so needs an extra name such as getcwdu. It'd be
> a good idea here to work out a naming convention for this distinction now so
> it can be used for more functions in the future.
It's gonna be ugly anyhow, so appending a 'u' is fine with me.
> > Aren't there some #ifdefs missing? posix_str have code
> > that's only relevant for Windows but isn't #ifdef'ed out
> > like it is elsewhere.
> I didn't have more #ifdefs to shorten the code. The #ifdefs that exist
> are to hide symbols (like _wmkdir) that may only be available on Windows.
> The Unicode paths are guarded by unicode_file_names() so will be avoided on
> other platforms. It doesn't matter greatly to me if there are additional
> compile time guards although taking it further to have the extra (wide)
> arguments to posix_str only on Windows would obfuscate the code.
Those are all details. We can finesse that when we get closer to
agreeing on the semantics. I think code that we know will never be
executed on Unix should be inside #ifdefs. Maybe we should reconsider
moving the Windows code to a separate file...
--Guido van Rossum (home page: http://www.python.org/~guido/)