Re: Read-only error

Mats Wichmann <[email protected]> Mon, 13 Jul 2026 09:40:50 -0600
Newsgroups gmane.comp.python.general
Message-ID <[email protected]>
On 7/13/26 08:59, Rob Cliffe via Python-list wrote:
> Thanks for your reply, Random.
> 
> On 13/07/2026 06:44, Random832 wrote:
>> On Sun, Jul 12, 2026, at 21:13, Rob Cliffe via Python-list wrote:
>>> It seems to be that it would be useful to have a FileReadOnly error.
>>> Currently trying to delete a read-only file raises a PermissionError,
>>> which not especially informative, and arguably even misleading.
>> First of all, how is it misleading?
> It is "arguably misleading" in that it suggests - at least to me - that 
> the caller does not have the required permissions to delete the file.
> Which is likely not the case.
On Windows, you by default need a file to be writable to be able to 
delete it, so it's exactly permission (some utilities will prompt you 
whether you want to remove anyway rather than failing, while others will 
just fail  - cmd.exe says "Access is denied." - but that's an individual 
decision, not the OS response.