summaryrefslogtreecommitdiff
path: root/Lib/fileinput.py
diff options
context:
space:
mode:
authorZhiming Wang <zmwangx@gmail.com>2017-09-05 01:37:24 +0800
committerericvsmith <ericvsmith@users.noreply.github.com>2017-09-04 13:37:24 -0400
commit06de1aeff94e524bed21d188065c4cd1590fb046 (patch)
tree67a27d5e57c48158f66d36a99907ae07d8578f34 /Lib/fileinput.py
parenta2344851abd3b146ff09d3fc13adb262a7c5450b (diff)
downloadcpython-git-06de1aeff94e524bed21d188065c4cd1590fb046.tar.gz
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.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index 363c241c50..c6fc9a1981 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: