From 3e1d62171f80f1b4b4f7ae9dea7f7b6624439ff1 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 13 Apr 2015 14:33:29 +0200 Subject: [PATCH] Ignore -psn_0_* argument on OS X. See #384. --- qutebrowser/qutebrowser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qutebrowser/qutebrowser.py b/qutebrowser/qutebrowser.py index ee6663f0f..7b9d868c0 100644 --- a/qutebrowser/qutebrowser.py +++ b/qutebrowser/qutebrowser.py @@ -119,7 +119,14 @@ def get_argparser(): def main(): """Main entry point for qutebrowser.""" parser = get_argparser() - args = parser.parse_args() + if sys.platform == 'darwin' and getattr(sys, 'frozen', False): + # Ignore Mac OS X' idiotic -psn_* argument... + # http://stackoverflow.com/questions/19661298/ + # http://sourceforge.net/p/cx-freeze/mailman/message/31041783/ + argv = [arg for arg in sys.argv[1:] if not arg.startswith('-psn_0_')] + else: + argv = sys.argv[1:] + args = parser.parse_args(argv) if args.json_args is not None: # Restoring after a restart. # When restarting, we serialize the argparse namespace into json, and