locking a branch should not try to import pwd when running as a windows service
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Bazaar | Status tracked in Trunk | |||||
2.3 |
Fix Released
|
High
|
Alexander Belchenko | |||
Trunk |
Fix Released
|
High
|
Alexander Belchenko |
Bug Description
If bzr is running as a service on windows, not only is no bzr user set, but the normal environmental variables that contain a user name are absent as well. This leads to tracebacks like the following if bzr tries to lock a branch:
Traceback (most recent call last):
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "getpass.pyo", line 152, in getuser
ImportError: No module named pwd
In bzrlib.
try:
user = config.username()
except errors.NoWhoami:
user = osutils.
But getpass.getuser falls through to importing pwd, which doesn't exist on windows, if the enviroment doesn't contain what it expects.
Related branches
- John A Meinel: Approve
-
Diff: 100 lines (+40/-0)4 files modifiedbzrlib/osutils.py (+12/-0)
bzrlib/tests/features.py (+15/-0)
bzrlib/tests/test_osutils.py (+9/-0)
doc/en/release-notes/bzr-2.3.txt (+4/-0)
Changed in bzr: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
tags: | added: win32 |
Changed in bzr: | |
assignee: | nobody → Alexander Belchenko (bialix) |
status: | Confirmed → In Progress |
I would have thought on the server side we'd be using a username
supplied by the client anyhow, so this is doubly unnecessary.