summaryrefslogtreecommitdiffstats
path: root/Lib/fileinput.py
diff options
context:
space:
mode:
authorZhiming Wang <zmwangx@gmail.com>2017-09-04 17:37:24 (GMT)
committerericvsmith <ericvsmith@users.noreply.github.com>2017-09-04 17:37:24 (GMT)
commit06de1aeff94e524bed21d188065c4cd1590fb046 (patch)
tree67a27d5e57c48158f66d36a99907ae07d8578f34 /Lib/fileinput.py
parenta2344851abd3b146ff09d3fc13adb262a7c5450b (diff)
downloadcpython-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.py2
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: