which is the right file path format in python3.4 ?

Chris Angelico rosuav at gmail.com
Sun Dec 14 06:09:32 EST 2014


On Sun, Dec 14, 2014 at 10:03 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Run this code and show us what it prints:
>
> import os
> print(os.stat("F:\\")
> print(os.access("F:\\", os.O_RDWR))

(With an extra close parenthesis on the first print call)

I'm suspicious here that drive F might not even exist. I would expect
a permissions error to be errno 13, but "invalid argument" seems
really weird. Definitely these checks will be informative.

ChrisA



More information about the Python-list mailing list