From 39084d5cbe1b35bc716676f725f370afe394af88 Mon Sep 17 00:00:00 2001 From: Lawrence Hudson Date: Tue, 25 Oct 2016 07:10:33 +0100 Subject: [PATCH 1/2] [#367] fix reveal file for Windows --- CHANGELOG.md | 1 + inselect/lib/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6169554..ab4c7a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ This is an overview of major changes. Refer to the git repository for a full log Version 0.1.35 ------------- +- #367 Reveal file doesn't work on Windows - #273 Inselect as a package - #83 Architecture and code organisation diff --git a/inselect/lib/utils.py b/inselect/lib/utils.py index 9d822a1..69d485a 100644 --- a/inselect/lib/utils.py +++ b/inselect/lib/utils.py @@ -136,7 +136,7 @@ def user_name(): """ if pwd: # Strip trailing commas seen on Linux - return pwd.getpwuid(os.getuid()).pw_gecos.rstrip(',') + return unicode(pwd.getpwuid(os.getuid()), 'utf8').pw_gecos.rstrip(',') else: try: import pywintypes From 5c012c42b780bf8147418d4f7853b88c424ade8f Mon Sep 17 00:00:00 2001 From: Lawrence Hudson Date: Tue, 25 Oct 2016 07:31:51 +0100 Subject: [PATCH 2/2] [#367] correct commit for fixing reveal file for Windows --- inselect/gui/utils.py | 2 +- inselect/lib/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inselect/gui/utils.py b/inselect/gui/utils.py index 6e7c52a..9d8cfba 100644 --- a/inselect/gui/utils.py +++ b/inselect/gui/utils.py @@ -210,7 +210,7 @@ def reveal_path(path): # http://stackoverflow.com/a/3546503 path = path.resolve() if sys.platform.startswith("win"): - res = subprocess.call(["explorer.exe", u"/select,{0}".format(path)]) + res = subprocess.call(u"explorer.exe /select,{0}".format(path)) if 1 != res: raise ValueError('Unexpected exit code [{0}]'.format(res)) elif 'Darwin' == platform.system(): diff --git a/inselect/lib/utils.py b/inselect/lib/utils.py index 69d485a..9d822a1 100644 --- a/inselect/lib/utils.py +++ b/inselect/lib/utils.py @@ -136,7 +136,7 @@ def user_name(): """ if pwd: # Strip trailing commas seen on Linux - return unicode(pwd.getpwuid(os.getuid()), 'utf8').pw_gecos.rstrip(',') + return pwd.getpwuid(os.getuid()).pw_gecos.rstrip(',') else: try: import pywintypes