From b189c31fc4cc01c40ced82f97c616aa0bc461cf0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 5 May 2015 16:34:36 +0530 Subject: [PATCH] E-book viewer: Fix print to pdf not working on some windows systems with non-ascii usernames and non-utf-8 system locales --- src/calibre/gui2/viewer/printing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/printing.py b/src/calibre/gui2/viewer/printing.py index fd080bf6bb..637a74ec9e 100644 --- a/src/calibre/gui2/viewer/printing.py +++ b/src/calibre/gui2/viewer/printing.py @@ -20,6 +20,7 @@ from calibre.gui2.widgets2 import Dialog from calibre.gui2.viewer.main import vprefs from calibre.utils.icu import numeric_sort_key from calibre.utils.ipc.simple_worker import start_pipe_worker +from calibre.utils.filenames import expanduser class PrintDialog(Dialog): @@ -38,7 +39,7 @@ class PrintDialog(Dialog): self.file_name = f = QLineEdit(self) val = dynamic.get(self.OUTPUT_NAME, None) if not val: - val = os.path.expanduser('~') + val = expanduser('~') else: val = os.path.dirname(val) f.setText(os.path.abspath(os.path.join(val, self.default_file_name)))