[spyder] 01/02: Cherry-pick upstream fix for overreliance on the USER envvar

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Apr 4 11:11:00 UTC 2017


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository spyder.

commit e78d13e530d82896e5e7dd8d88fc271309e7c845
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Tue Apr 4 11:56:54 2017 +0100

    Cherry-pick upstream fix for overreliance on the USER envvar
    
    New patch More-robust-username-query.patch
    
    Gbp-Dch: full
    Closes: #859080
    Thanks: Chris Lamb for reporting
---
 debian/patches/More-robust-username-query.patch | 27 +++++++++++++++++++++++++
 debian/patches/series                           |  1 +
 2 files changed, 28 insertions(+)

diff --git a/debian/patches/More-robust-username-query.patch b/debian/patches/More-robust-username-query.patch
new file mode 100644
index 0000000..158e8bf
--- /dev/null
+++ b/debian/patches/More-robust-username-query.patch
@@ -0,0 +1,27 @@
+From: Ghislain Antony Vaillant <noreply at github.com>
+Date: Sun, 2 Apr 2017 19:29:55 -0500
+Subject: More robust username query
+
+The current method for querying the username via the `USER` envvar
+is fragile and may yield to
+[problems](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859080).
+This PR proposes to use the `getpass` module from the stdlib instead,
+which should be more robust.
+---
+ spyder/utils/programs.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/spyder/utils/programs.py b/spyder/utils/programs.py
+index ad3b24a..dd72bf5 100644
+--- a/spyder/utils/programs.py
++++ b/spyder/utils/programs.py
+@@ -30,7 +30,8 @@ class ProgramError(Exception):
+ if os.name == 'nt':
+     TEMPDIR = tempfile.gettempdir() + osp.sep + 'spyder'
+ else:
+-    username = encoding.to_unicode_from_fs(os.environ.get('USER'))
++    from getpass import getuser
++    username = encoding.to_unicode_from_fs(getuser())
+     TEMPDIR = tempfile.gettempdir() + osp.sep + 'spyder-' + username
+ 
+ 
diff --git a/debian/patches/series b/debian/patches/series
index b23c4da..a7368f6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-fix-spyderlib-path.patch
 Fix-autocompletion-with-Jedi-0.10.patch
+More-robust-username-query.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/spyder.git



More information about the debian-science-commits mailing list