At http://bzr.arbash-meinel.com/branches/bzr/1.10-dev/catch_pwd_error
------------------------------------------------------------
revno: 3850
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
author: Andrew Bennetts <[EMAIL PROTECTED]>
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: catch_pwd_error
timestamp: Tue 2008-11-25 11:19:26 -0600
message:
Catch exceptions from pwd and raise a better error
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py 2008-10-16 18:30:32 +0000
+++ b/bzrlib/config.py 2008-11-25 17:19:26 +0000
@@ -839,7 +839,11 @@
try:
import pwd
uid = os.getuid()
- w = pwd.getpwuid(uid)
+ try:
+ w = pwd.getpwuid(uid)
+ except KeyError:
+ raise errors.BzrCommandError('Unable to determine your name. '
+ 'Please use "bzr whoami" to set it.')
# we try utf-8 first, because on many variants (like Linux),
# /etc/passwd "should" be in utf-8, and because it's unlikely to give
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits