Launchpadlib crashes if os.environ['HOME'] not set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
launchpadlib |
Fix Committed
|
Low
|
Martin Packman |
Bug Description
If os.environ['HOME'] isn't set, Launchpadlib's login_anonymously fails:
anthony@atenea:~$ unset HOME
anthony@
Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from launchpadlib.
>>> Launchpad.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
service_
File "/usr/lib/
home_dir = os.environ['HOME']
File "/usr/lib/
raise KeyError(key)
KeyError: 'HOME'
>>>
This bites you when deploying in environments that don't ensure os.environ['HOME'] is set, as with Apache + modwsgi.
Related branches
- Robert Collins (community): Approve
- Graham Binns (community): Needs Fixing (code)
-
Diff: 17 lines (+4/-2)1 file modifiedsrc/launchpadlib/launchpad.py (+4/-2)
Changed in launchpadlib: | |
status: | Triaged → In Progress |
Changed in launchpadlib: | |
status: | In Progress → Fix Committed |
Hi there, using mod_wsgi or the like is very unsafe - see bug 459418 : we really want single-threaded environments for launchpadlib today. I'd love a concurrent environment or a cacheless variant :)