From f84223da033c71ee7ae7c9dfe247c4b189e4a1c3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Sep 2015 22:02:49 +0530 Subject: [PATCH] Revert change in previous release to workaround broken xdg-open on linux. Apparently xdg-open is so badly broken that working around it is not possible. Fixes #1500226 [Calibre 2.39 (Xubuntu) - # character use in the title](https://bugs.launchpad.net/calibre/+bug/1500226) I love xdg-utils --- src/calibre/gui2/__init__.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index a71930021e..61ff696790 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -3,7 +3,7 @@ __copyright__ = '2008, Kovid Goyal ' """ The GUI """ import os, sys, Queue, threading, glob from contextlib import contextmanager -from threading import RLock, Lock, Thread +from threading import RLock, Lock from urllib import unquote from PyQt5.QtWidgets import QStyle # Gives a nicer error message than import from Qt from PyQt5.Qt import ( @@ -1140,15 +1140,6 @@ def open_local_file(path): if iswindows: with sanitize_env_vars(): os.startfile(os.path.normpath(path)) - elif islinux or isbsd: - import subprocess - if isinstance(path, unicode): - path = path.encode(filesystem_encoding) - with sanitize_env_vars(): - p = subprocess.Popen(['xdg-open', path]) - t = Thread(name='WaitXDGOpen', target=p.wait) - t.daemon = True - t.start() else: url = QUrl.fromLocalFile(path) open_url(url)