Skip to content

Commit

Permalink
Use a more portable way of finding the users login.
Browse files Browse the repository at this point in the history
os.getlogin() isn't reliable, and requires a login shell for it to
work. A more portable method is to use getuser from the getpass module.

Reference:

https://stackoverflow.com/questions/842059/is-there-a-portable-way-to-get-the-current-username-in-python
http://www.postgresql.org/message-id/20060512221230.0D04486C565@pgfoundry.org
  • Loading branch information
Greg Fitzgerald committed Feb 10, 2014
1 parent 6f68d12 commit 80dee4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import with_statement
import sys
import os
import getpass
import codecs
import geeknote
from setuptools import setup
Expand Down Expand Up @@ -35,7 +36,8 @@ class full_install(install):

user_options = install.user_options + [
('userhome', None, "(Linux only) Set user home directory for"
" bash completion (/home/{0})".format(os.getlogin()))
" bash completion (/home/{0})"
.format(getpass.getuser()))
]

def initialize_options(self):
Expand Down

0 comments on commit 80dee4b

Please sign in to comment.