Message416618
> 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. |
|
Date |
User |
Action |
Args |
2022-04-03 13:04:38 | jaraco | set | recipients:
+ jaraco, petr.viktorin, docs@python |
2022-04-03 13:04:38 | jaraco | set | messageid: <1648991078.04.0.66010638988.issue47142@roundup.psfhosted.org> |
2022-04-03 13:04:38 | jaraco | link | issue47142 messages |
2022-04-03 13:04:37 | jaraco | create | |
|