On Mon, Nov 8, 2010 at 8:34 AM, Philip Semanchuk <phi...@semanchuk.com> wrote:
> Hi Ryan,
> Thanks. I don't know why sudo behaves the way it does with regard to $HOME, 
> but the behavior of sudo is not under my control (nor matplotlib's). Also, I 
> expect that *lots* of software depends on this behavior of sudo so changing 
> it is probably not an option.
>

Sounds like you've found your solution (which is great), but to set
the record straight, you *can* control the behavior of sudo. In
/etc/sudoers, you can set env_reset to reset the environment, so none
of your variables (like $HOME). You can also just specify certain
variables to be reset. There is also an option always_set_home which
seems to do the right thing. In fact, on my machine, sudo works just
fine:

~> sudo python -c 'import os;print os.environ["HOME"]'
/root

So, so long as you can edit /etc/sudoers, you are *very much* in
control of how sudo works in this regard.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to