[issue36128] ResourceReader for FileLoader inconsistently handles path separators

2021-05-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: The preferred API as implemented in Python 3.9 and importlib_resources 1.1 is the `files()` API. This simpler API returns a Traversable object, a pathlib-like handle to the contents of a package. This approach side-steps the issues described above. In

[issue36128] ResourceReader for FileLoader inconsistently handles path separators

2019-11-11 Thread Gregory Szorc
Gregory Szorc added the comment: I just noticed that there is a parallel discussion ongoing in https://gitlab.com/python-devs/importlib_resources/issues/58. -- ___ Python tracker

[issue36128] ResourceReader for FileLoader inconsistently handles path separators

2019-11-11 Thread Gregory Szorc
Gregory Szorc added the comment: I think disallowing relative paths that are parents of the current anchor point is a reasonable restriction and acceptable backwards incompatible behavior. Disallowing all relative paths with slashes is a larger issue. I would support that if

[issue36128] ResourceReader for FileLoader inconsistently handles path separators

2019-11-11 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: One simple restriction would be to disallow relative paths outside of the resource anchor location. -- ___ Python tracker ___

[issue36128] ResourceReader for FileLoader inconsistently handles path separators

2019-11-11 Thread Marcin Kasperski
Marcin Kasperski added the comment: Hmm, I noticed this but accidentally and tried to port https://github.com/pypa/setuptools/issues/1635 to new api. Well: >>> import multiprocessing >>> import sys >>> reader = >>>

[issue36128] ResourceReader for FileLoader inconsistently handles path separators

2019-02-27 Thread Brett Cannon
Change by Brett Cannon : -- nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36128] ResourceReader for FileLoader inconsistently handles path separators

2019-02-26 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Feb 26, 2019, at 13:05, Gregory Szorc wrote: > > I would think the two would agree about whether a path with separators is a > resource or not. The documentation at > https://docs.python.org/3.7/library/importlib.html#importlib.abc.ResourceReader >

[issue36128] ResourceReader for FileLoader inconsistently handles path separators

2019-02-26 Thread Gregory Szorc
New submission from Gregory Szorc : The implementation of the ResourceReader API for the FileLoader class in importlib/_bootstrap_external.py is inconsistent with regards to handling of path separators. Specifically, "is_resource()" returns False if "resource" has a path separator. But