From 8fff496ffd0c5ff935169a490669ec078b81950a Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Sat, 26 May 2018 22:55:22 -0700 Subject: [PATCH] Fix Py3.5 not understanding os.path.exists(Path(...)) --- src/ocrmypdf/helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ocrmypdf/helpers.py b/src/ocrmypdf/helpers.py index 660e2710..cb73cc77 100644 --- a/src/ocrmypdf/helpers.py +++ b/src/ocrmypdf/helpers.py @@ -29,7 +29,8 @@ def re_symlink(input_file, soft_link_name, log=None): """ Helper function: relinks soft symbolic link if necessary """ - + input_file = str(input_file) # For Py3.5 + soft_link_name = str(soft_link_name) if log is None: prdebug = partial(print, file=sys.stderr) else: @@ -103,7 +104,7 @@ def is_file_writable(test_file): if p.is_symlink(): # Python 3.5 does not accept parameters for Path.resolve() and behaves - # as if strict=True (throws an exception on failure). Python 3.6 + # as if strict=True (throws an exception on failure). Python 3.6 # defaults to strict=False. This implements strict=False like behavior # for Python 3.5. if sys.version_info[0:2] <= (3, 5):