[Python-Dev] test_pep277 vs Win98

Martin v. Loewis martin@v.loewis.de
05 Oct 2002 05:05:58 +0200


"Mark Hammond" <mhammond@skippinet.com.au> writes:

> > Not exactly sure what to do about this.  Maybe we should expose
> > posixmodule's unicode_file_names() function - some way of
> > indicating if the underlying file system supports Unicode.

I think we already rejected this approach when developing the PEP. The
function name would be misleading: You can pass Unicode as a file name
on all systems, thanks to the file system default encoding.

> * Added os._get_windows_version() as an alias for the Win32 GetVersion()
> function. We then clone the test in posixmodule.c for test_pep277.py, and
> life is good.  This function would be generally useful - it is almost a FAQ
> on c.l.python and all the answers are generally unsatisfactory.

I would like this approach, although I'm uncertain why the function
name needs to start with an underscore (for that matter, I also wonder
why _winreg starts with an underscore).

os.windows_version() sounds good to me, although I could also accept
os.get_windows_version(). Even os.version might work.

> * Added os._unicode_file_apis(), which exposes the internal posixmodule
> function unicode_file_names().  Currently this is simply a GetVersion()
> call, but later it may grow additional checks.

You like underscores really much :-) See above. Also, I think the
likelyness of adding additional checks is very small: The only other
candidate system to provide a similar feature would be OS X. However,
macmodule.c lives elsewhere, to my knowledge.

> * Did something else completely <wink>

Perhaps there is already a way to find out the windows version you are
running? Perhaps by looking at the registry?

Regards,
Martin