[Python-Dev] test_pep277 vs Win98

Tim Peters tim.one@comcast.net
Fri, 04 Oct 2002 23:09:01 -0400


[Mark Hammond]
> OK - in the efforts of actually progressing something <wink>, would you
> prefer a patch that:
>
> * 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 agree that would be (very) useful to have, but also agree with your
unstated but fiercly held belief that it's a hacky solution to the immediate
problem at hand <wink>.

> * 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.

This sounds more direct, but loses me.  Presumably the test is testing
something <wink> that *could* be a given an informative name.  Think like a
Tim here:  what does this test *do*?  Then why is it that Windows NT+ are
the only OSes on Earth where it's possible to do that thing?  Or are the
only OSes on Earth where it's necessary to do that thing?  A Tim-friendly
one-word answer to that question would give a nice name for a new boolean
attribute to test:

if not os.supports_FRIENDLY_NAME:
    rase TestSkipped, "test requires os.supports_FRIENDLY_NAME"

I don't know what FRIENDLY_NAME should be, but "_unicode_file_apis()"
doesn't seem likely to be it.