Message405837
The documentation for Traversable.name says it is a method, not a property:
https://docs.python.org/3/library/importlib.html#importlib.abc.Traversable.name
The issue is that with Python 3.9.7 (default, Nov 1 2021, 11:26:33), using a standard posix module (on MacOSX), it returns a string and not a method. I have not tested on newer versions, but expect similar issues. I have tagged the newer versions to get exposure, feel free to untag the versions that are confirmed to be unaffected by this bug.
```
$ python3.9
Python 3.9.7 (default, Nov 1 2021, 11:26:33)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mod
<class 'str'>
>>> ^D
```
This is with a module dir named `mod`, w/ an empty `res.txt` file, and the following in `__init__.py`:
```
from importlib import resources
r = resources.files(__name__) / 'res.txt'
print(repr(type(r.name)))
``` |
|
Date |
User |
Action |
Args |
2021-11-06 01:23:27 | jmg | set | recipients:
+ jmg |
2021-11-06 01:23:27 | jmg | set | messageid: <1636161807.52.0.0427102935668.issue45733@roundup.psfhosted.org> |
2021-11-06 01:23:27 | jmg | link | issue45733 messages |
2021-11-06 01:23:27 | jmg | create | |
|