--- a/src/eric7/SystemUtilities/FileSystemUtilities.py Sun Dec 10 17:06:00 2023 +0100 +++ b/src/eric7/SystemUtilities/FileSystemUtilities.py Sun Dec 10 17:49:42 2023 +0100 @@ -740,18 +740,19 @@ """ filePath = str(filePath) - if OSUtilities.isWindowsPlatform(): - return os.startfile(filePath) # secok - - elif OSUtilities.isMacPlatform(): - return subprocess.call(("open", filePath)) # secok + with contextlib.suppress(OSError): + if OSUtilities.isWindowsPlatform(): + os.startfile(filePath) # secok + return True - elif OSUtilities.isLinuxPlatform() or OSUtilities.isFreeBsdPlatform(): - return subprocess.call(("xdg-open", filePath)) # secok + elif OSUtilities.isMacPlatform(): + return subprocess.call(("open", filePath)) == 0 # secok - else: - # unsupported platform - return False + elif OSUtilities.isLinuxPlatform() or OSUtilities.isFreeBsdPlatform(): + return subprocess.call(("xdg-open", filePath)) == 0 # secok + + # unsupported platform or OSError + return False ################################################################################