[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] os.getlogin() bug
From: |
Jordi Funollet |
Subject: |
[Fab-user] os.getlogin() bug |
Date: |
Sun, 13 Jul 2008 23:59:20 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Christian,
In my setup (Ubuntu 8.04 + Kde) the function 'os.getlogin()' returns an error
under Konsole, but runs correctly if I switch to a vtty (out of Xwindows).
After googling a little bit it looks like 'getlogin' is broken;
getpass.getuser() gives the same functionality and is more robust. So that's
the trivial patch (for the 0.0.7 source):
# ---------------------------------------------------------------
--- fabric/fabric.py 2008-07-01 01:15:09.000000000 +0200
+++ fabric_changes/fabric.py 2008-07-13 23:54:37.000000000 +0200
@@ -56 +56 @@
- 'fab_user': os.getlogin(),
+ 'fab_user': getpass.getuser(),
# ---------------------------------------------------------------
And an small tip: just 'import readline' on fabric.py and we'll have
readline-like history on the 'fab shell', for free.
--
##############################
### Jordi Funollet
### http://www.terraquis.net
- [Fab-user] os.getlogin() bug,
Jordi Funollet <=