From 6ef53c814c691a04783441576a8dfc563e704fea Mon Sep 17 00:00:00 2001 From: cryzed Date: Sun, 13 Aug 2017 02:34:50 +0200 Subject: [PATCH] Expand ~ to user's home on Linux --- qutebrowser/browser/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index f3f71d910..1f6994225 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -2048,8 +2048,9 @@ class CommandDispatcher: message.info(out) if file: + path = os.path.expanduser(js_code) try: - with open(js_code, 'r', encoding='utf-8') as f: + with open(path, 'r', encoding='utf-8') as f: js_code = f.read() except OSError as e: raise cmdexc.CommandError(str(e))