[Python-Dev] Special file "nul" in Windows and os.stat

Mark Hammond mhammond at skippinet.com.au
Wed Oct 24 23:42:58 CEST 2007

> So, the question is what we should do?:
> 1. Rely on the kernel32 function and behaves like it says?
> 2. Return a fixed response for this special file "nul"?
> Personally, I prefer the first one, but it changed the semantic of
> os.path.exists("nul") (but this semantic is not clear, as we get
> different behaviour in different Python versions and windows
> versions).

Note that the same issue would exist for 'aux', 'con' and 'prn' too -
'comXX' 'lptXX' 'clock$' also seem to get special treatment.  I agree it is
unfortunate that the behaviour has changed, but these special names are
broken enough on Windows that (1) seems the sanest thing to do.


More information about the Python-Dev mailing list