[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-23 Thread Filipe Laíns
Filipe Laíns added the comment: That makes sense, I wish all these details were documented, but it is more than enough precedent to choose to not add such enforcements to the specification. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed

[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: Having a look at the `open` function (https://docs.python.org/3/library/functions.html#open), it does not define which exceptions might be thrown. Similarly for pathlib.Path.open (https://docs.python.org/3/library/pathlib.html#pathlib.Path.open) and zipfil

[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-23 Thread Filipe Laíns
Filipe Laíns added the comment: Okay. Having a better look at it, I think we should only add this specification to open(). Traversable, by design, makes it totally plausible that open() cannot be performed. It could be a nonexistent path, the Traversable could represent object where open()

[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: After reviewing the PR, I'm not convinced the Traversable methods need any specification about when to raise FileNotFoundError (or other exceptions). Let's flesh out what conditions demand prescribed interfaces. -- _

[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-20 Thread Filipe Laíns
Change by Filipe Laíns : -- keywords: +patch pull_requests: +24878 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26272 ___ Python tracker ___

[issue44196] Document that importlib.abc.Traversable's methods should raise FileNotFoundError

2021-05-20 Thread Filipe Laíns
New submission from Filipe Laíns : ResourceReader used to have this requirement, Traversable does not. We cannot add a requirement as there might be users not doing this, but we can ask new users to do so. We should document that FileNotFoundError should be raised if a file is not found, but