Why exception from os.path.exists()?

Chris Angelico rosuav at gmail.com
Sat Jun 2 20:38:34 EDT 2018


On Sun, Jun 3, 2018 at 10:08 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Chris, you seem to be labouring under the misapprehension that the claim
> is that a stock standard Windows <whatever version> installation complies
> with the latest version of the POSIX standard.
>
> That's not the case.
>
> The claim (and fact) is that Windows NT with the POSIX subsystem
> installed (and possibly other changes made) is technically compliant with
> version 1 of the POSIX standard, which even in 1997 was only a fraction
> of what most Unix systems provided.
>
> https://en.wikipedia.org/wiki/POSIX#Versions
>
> Just enough to allow bean counters to tick the box that says "POSIX
> compliant" in a government requirements form, provided the technical
> people involved either don't get a say, or do get a say and actually want
> Windows but have to satisfy some bureaucratic requirement for POSIX.
>
> Nobody thinks that standard Windows counts as a Unix.

Let's just rewind this subthread a little bit. YOU said that the
behaviour of os.path.exists on Unix systems should be "return False
for invalid things" on the basis that the Windows invalid paths return
False. Remember? Or are you just too het up about arguing this point
that you don't care why you're arguing? I said that Windows isn't
POSIX, and pointed out just a couple of ways in which, to a
programmer, Windows behaves very differently to POSIX-compliant
systems. The two examples I gave were signals and relative paths. Now,
if you want to tell me that we can completely ignore drive letters on
Windows, then sure. Go ahead. Tell me that relative paths behave
sanely on Windows just as long as you have only a single drive. Or
tell me that the POSIX standard permits three different types of
relative path. And with signals, can you show me that a process can
send another process a variety of different signals, and that the
receiving process can handle them differently?

Claiming that Windows technically ticks some box is utterly meaningless to that.

ChrisA



More information about the Python-list mailing list