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 jmg
Recipients jmg
Date 2021-11-06.01:23:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1636161807.52.0.0427102935668.issue45733@roundup.psfhosted.org>
In-reply-to
Content
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)))
```
History
Date User Action Args
2021-11-06 01:23:27jmgsetrecipients: + jmg
2021-11-06 01:23:27jmgsetmessageid: <1636161807.52.0.0427102935668.issue45733@roundup.psfhosted.org>
2021-11-06 01:23:27jmglinkissue45733 messages
2021-11-06 01:23:27jmgcreate