Eric V. Smith added the comment:
I've been thinking about this some more, and I agree with Terry. Changing str()
seems dangerous, and __fspath__ wouldn't be backwardly compatible. If you want
the name, use .name. So I'm going to close this.
--
resolution: -> rejected
stage: -> reso
Terry J. Reedy added the comment:
Making str(td) == td.name does not seem useful. I think this should be closed
as 'Not a bug', because it isn't. If changed to an enhancement request, reject
as insufficiently warranted against the likely breakage.
--
nosy: +terry.reedy
___
Eric V. Smith added the comment:
I agree with Serhiy: changing TemporaryDirectory.__str__() definitely has
drawbacks.
I assume gitPython is using str() where they might want to use os.fspath().
Maybe tempfile.TemporaryDirectory (and similar) could then support __fspath__.
--
nosy: +
Serhiy Storchaka added the comment:
It is a bug in gitPython.
As for adding a new feature, making TemporaryDirectory.__str__() returning just
a name, I am not sure that it is needed, and it has drawbacks. If print() for
TemporaryDirectory object will output just a directory name, it can crea
New submission from Eric Osborne :
When I create a temporary directory, the name doesn't come back in a way the
application expects it. I ran into this using gitPython and I'm not entirely
clear whether it's a tmpfile issue or a gitpython issue, but I think it's
tempfile.
Repro:
In [12]: