Message317666
os.fspath() returns its argument if it is a str. That means that it bypasses __fspath__ for str subclasses.
This is the case for the library path.py for example.
This is a corner case that was discovered while trying to fix https://github.com/matplotlib/matplotlib/issues/11306
Minimal example:
```
import os
class MyPath(str):
def __fspath__(self):
print("Returns a pure string")
return str(self)
os.fspath(MyPath()) # Prints nothing
``` |
|
Date |
User |
Action |
Args |
2018-05-25 10:00:01 | contrebasse | set | recipients:
+ contrebasse |
2018-05-25 10:00:01 | contrebasse | set | messageid: <1527242401.32.0.682650639539.issue33646@psf.upfronthosting.co.za> |
2018-05-25 10:00:01 | contrebasse | link | issue33646 messages |
2018-05-25 10:00:01 | contrebasse | create | |
|