Fix Python 3.5 pathlib regressions
This commit is contained in:
@@ -21,6 +21,7 @@ from functools import lru_cache
|
||||
from ..exceptions import InputFileError, SubprocessOutputError, \
|
||||
EncryptedPdfError
|
||||
from . import get_version
|
||||
from ..helpers import fspath
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
@@ -32,7 +33,7 @@ def check(input_file, log=None):
|
||||
args_qpdf = [
|
||||
'qpdf',
|
||||
'--check',
|
||||
input_file
|
||||
fspath(input_file)
|
||||
]
|
||||
|
||||
if log is None:
|
||||
|
||||
@@ -25,7 +25,7 @@ from subprocess import CalledProcessError, TimeoutExpired, check_output, STDOUT,
|
||||
from contextlib import suppress
|
||||
|
||||
from ..exceptions import MissingDependencyError, TesseractConfigError
|
||||
from ..helpers import page_number
|
||||
from ..helpers import page_number, fspath
|
||||
from . import get_version
|
||||
|
||||
OrientationConfidence = namedtuple(
|
||||
@@ -135,7 +135,7 @@ def tess_base_args(langs, engine_mode):
|
||||
def get_orientation(input_file, engine_mode, timeout: float, log):
|
||||
args_tesseract = tess_base_args(['osd'], engine_mode) + [
|
||||
psm(), '0',
|
||||
input_file,
|
||||
fspath(input_file),
|
||||
'stdout'
|
||||
]
|
||||
|
||||
|
||||
+3
-1
@@ -25,6 +25,7 @@ import pytest
|
||||
from PIL import Image, ImageChops
|
||||
|
||||
import ocrmypdf.leptonica as lept
|
||||
from ocrmypdf.helpers import fspath
|
||||
|
||||
|
||||
def test_colormap_backgroundnorm(resources):
|
||||
@@ -86,4 +87,5 @@ def test_leptonica_compile(tmpdir):
|
||||
# Compile the library but build it somewhere that won't interfere with
|
||||
# existing compiled library. Also compile in API mode so that we test
|
||||
# the interfaces, even though we use it ABI mode.
|
||||
ffibuilder.compile(tmpdir=tmpdir, target=(tmpdir / 'lepttest.*'))
|
||||
ffibuilder.compile(tmpdir=fspath(tmpdir),
|
||||
target=fspath(tmpdir / 'lepttest.*'))
|
||||
|
||||
Reference in New Issue
Block a user