diff --git a/app.py b/app.py index 4702406..37bea67 100755 --- a/app.py +++ b/app.py @@ -345,12 +345,30 @@ def use_cmd_optargs(options, args): # In case there is, try opening as it was a inv3 else: for arg in reversed(args): - if os.path.isfile(arg): - path_ = os.path.abspath(arg.decode(sys.stdin.encoding)) - Publisher.sendMessage('Open project', path_) - check_for_export(options) - return True + try: + file = arg + if os.path.isfile(file): + path = os.path.abspath(file) + Publisher.sendMessage('Open project', path) + check_for_export(options) + return True + except: + + file = arg.decode(sys.stdin.encoding) + if os.path.isfile(file): + path = os.path.abspath(file) + Publisher.sendMessage('Open project', path) + check_for_export(options) + return True + + file = arg.decode(FS_ENCODE) + if os.path.isfile(file): + path = os.path.abspath(file) + Publisher.sendMessage('Open project', path) + check_for_export(options) + return True + return False -- libgit2 0.21.2