This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaraco
Recipients docs@python, jaraco, petr.viktorin
Date 2022-04-03.13:04:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648991078.04.0.66010638988.issue47142@roundup.psfhosted.org>
In-reply-to
Content
> Are the methods expected to raise specific exception types (e.g. if a resource is missing, or you call iterdir on a “file”)?

The short answer is no. The protocol does not stipulate specific exceptions. Perhaps it should be documented that any exceptions that occur when accessing the backing resource will propagate. Although, I do believe that statement is true for all Python code unless stated otherwise.

I agree it would be nice if the protocol could stipulate which exceptions might be raised by a given implementation, but I'm not confident that's possible, at least not without wrapping/adapting the pathlib.Path and zipfile.Path objects.

Does that answer the question? Are you working on another provider that implements this protocol? I'd be happy to consult on that effort.
History
Date User Action Args
2022-04-03 13:04:38jaracosetrecipients: + jaraco, petr.viktorin, docs@python
2022-04-03 13:04:38jaracosetmessageid: <1648991078.04.0.66010638988.issue47142@roundup.psfhosted.org>
2022-04-03 13:04:38jaracolinkissue47142 messages
2022-04-03 13:04:37jaracocreate