[issue29447] Add os.PathLike support to the tempfile module's 'dir' arguments

Brett Cannon report at bugs.python.org
Wed May 3 12:34:14 EDT 2017


Brett Cannon added the comment:

Without looking at the PR there are two ways to interpret my unfortunately vague comment. One is to say that the objects returned by tempfile code should support os.PathLike; that's what Serhiy is objecting to as those are objects representing concrete things on the file system instead of a general concept of a path (i.e. open() returns a concrete file while pathlib returns a path). You could potentially argue that TemporaryDirectory can implement os.PathLike since it does represent a path on the file system, but I see where Serhiy is coming from about how this can be viewed as inappropriate.

The other way to interpret what I said was to make sure things like the 'dir' argument accepted path-like objects.

What I probably meant back in February was the first interpretation, but after hearing Serhiy's argument, I agree that the second interpretation is best. (My apologies to svelankar if they implemented the first idea.)

----------
title: Add os.PathLike support to the tempfile module -> Add os.PathLike support to the tempfile module's 'dir' arguments

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29447>
_______________________________________


More information about the Python-bugs-list mailing list