Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > os.environ['PATH'] missing

Reply
Thread Tools

os.environ['PATH'] missing

 
 
peterbe@gmail.com
Guest
Posts: n/a
 
      01-06-2006
This is a hard question to ask because I can't reproduce the problem
other than restarting several times over until it happens again.

I'm using Zope and Plone for a website on this debian linux vserver and
when I restart it it runs some /etc/init.d/zope restart scripts and
things fail in zope because somewhere deep in there the following
raises an AttributeError that 'PATH' doesn't exist:

foo = os.environ['PATH']

How can it not be present?
What might cause this seemingly random situation?

Has anybody had similar experiences where 'PATH' is not present in
os.environ?

 
Reply With Quote
 
 
 
 
Jorgen Grahn
Guest
Posts: n/a
 
      01-08-2006
On 6 Jan 2006 06:03:05 -0800, <> wrote:
....
> How can it not be present?
> What might cause this seemingly random situation?


Well, it's not uncommon to start a program with a reduced set of environment
variables, including a limited, hardcoded $PATH, so something like
os.system("ls") cannot be tricked to run an ls outside the
system-controlled, "safe" directories.

On my machine, "env -i sh" starts a shell without $PATH. Bash seems to
default to a builtin search path in that situation (/bin and /usr/bin, I
suppose).

But reducing $PATH is one thing (and fairly common); removing it is another.
And I'm not sure that programs are expected to cope with the absence of
$PATH; just because it's /possible/ to remove it doesn't mean it's legal.

I don't know anything about web servers and Zope. Sorry.

/Jorgen

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org> R'lyeh wgah'nagl fhtagn!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports - Visual Basic UFL that implements this function is missing (or U2lcom.dll is missing) Les Caudle ASP .Net 3 09-03-2007 02:27 AM
Re: missing feature classes and missing fields Gary Herron Python 2 07-04-2006 10:29 PM
missing wzcdlg.dll =?Utf-8?B?RGFuZGVl?= Wireless Networking 4 11-20-2004 02:14 PM
Missing Wireless Link applet =?Utf-8?B?Q2hyaXNzaWU=?= Wireless Networking 8 10-07-2004 07:24 PM
Missing Websites and no mail =?Utf-8?B?U2hpZnR3b3JrZXI0Mw==?= Wireless Networking 0 09-11-2004 12:31 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57