From c9b9871b2c9cbdd95f0ff0d18509da187e5aef65 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sun, 17 Sep 2023 15:14:58 +0200 Subject: [PATCH] For fpcalc use normpath instead of win_prefix_longpath This is platform independent and also handles the case where the system has native support for long paths. --- picard/acoustid/__init__.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/picard/acoustid/__init__.py b/picard/acoustid/__init__.py index 20be0ed8bbc..22eaeaa10a5 100644 --- a/picard/acoustid/__init__.py +++ b/picard/acoustid/__init__.py @@ -6,7 +6,7 @@ # Copyright (C) 2017-2018 Sambhav Kothari # Copyright (C) 2018 Vishal Choudhary # Copyright (C) 2018-2021 Laurent Monin -# Copyright (C) 2018-2022 Philipp Wolfer +# Copyright (C) 2018-2023 Philipp Wolfer # Copyright (C) 2023 Bob Swift # # This program is free software; you can redistribute it and/or @@ -40,11 +40,10 @@ DEFAULT_FPCALC_THREADS, FPCALC_NAMES, ) -from picard.const.sys import IS_WIN from picard.file import File from picard.util import ( find_executable, - win_prefix_longpath, + normpath, ) @@ -259,9 +258,7 @@ def _run_next_task(self): process.setProperty('picard_finished', False) process.finished.connect(partial(self._on_fpcalc_finished, task)) process.error.connect(partial(self._on_fpcalc_error, task)) - file_path = task.file.filename - if IS_WIN: - file_path = win_prefix_longpath(file_path) + file_path = normpath(task.file.filename) process.start(self._fpcalc, ["-json", "-length", "120", file_path]) log.debug("Starting fingerprint calculator %r %r", self._fpcalc, task.file.filename)