diff options
author | Zhiming Wang <zmwangx@gmail.com> | 2017-09-04 17:37:24 (GMT) |
---|---|---|
committer | ericvsmith <ericvsmith@users.noreply.github.com> | 2017-09-04 17:37:24 (GMT) |
commit | 06de1aeff94e524bed21d188065c4cd1590fb046 (patch) | |
tree | 67a27d5e57c48158f66d36a99907ae07d8578f34 /Lib/fileinput.py | |
parent | a2344851abd3b146ff09d3fc13adb262a7c5450b (diff) | |
download | cpython-06de1aeff94e524bed21d188065c4cd1590fb046.zip cpython-06de1aeff94e524bed21d188065c4cd1590fb046.tar.gz cpython-06de1aeff94e524bed21d188065c4cd1590fb046.tar.bz2 |
bpo-31281: Fix pathlib.Path incompatibility in fileinput (gh-3208)
Fix fileinput with inplace=True to accept pathlib.Path objects.
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r-- | Lib/fileinput.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py index 363c241..c6fc9a1 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -330,7 +330,7 @@ class FileInput: else: if self._inplace: self._backupfilename = ( - self._filename + (self._backup or ".bak")) + os.fspath(self._filename) + (self._backup or ".bak")) try: os.unlink(self._backupfilename) except OSError: |