Why does pathlib not have is_readable() & things like that?

eryk sun eryksun at gmail.com
Fri Apr 29 11:09:41 EDT 2016


On Fri, Apr 29, 2016 at 6:51 AM, Jussi Piitulainen
<jussi.piitulainen at helsinki.fi> wrote:
> Adam Funk writes:
>> On 2016-04-28, Grant Edwards wrote:
>
>>> Or just do os.access("directory/where/you/want/to/open/a/file",os.W_OK)
>>
>> That's what I'm doing now, but I prefer to give the user the error
>> message early on.
>
> Then do that early on.

Note that on Windows os.access only checks if a file is read-only.
There's a proposed update to check the file security. The patch needs
to be updated and needs to be reworked, but it's a low priority. For
the most part calling os.access isn't recommended.



More information about the Python-list mailing list