[PATCH] sys.modify_argv()

Malcolm Tredinnick malcolm at commsecure.com.au
Sat Aug 25 03:54:59 EDT 2001


On Fri, Aug 24, 2001 at 11:53:04PM -0400, Dave Cinege wrote:
> Ignacio Vazquez-Abrams wrote:
> > On Fri, 24 Aug 2001, Dave Cinege wrote:
> > > This patch adds a new feature to the sys module, modify_argv().
> > > As you might have guessed this allows one to change to absolute
> > > argv values of the python process itself. (It is of great wonder
> > > to me why this functionality is not already available...)
> > 
> > Instead of making a whole new function for this, why not add write
> > capability to sys.argv?
> 
> Why I didn't do this:
  
[...snip...]
> 3) It's not yet exactly clear (to me) to what extent you can alter argv
> and not impeed portability. This is probably reason enough to segregate this
> functionality. (On linux it stacks argv elements concurrently in memory and
> it's safe to use that total space anyway you want. Who knows
> how other OS's deal with it...)

Not much, is the short answer. Jamie Zawinski has told me that when
Netscape was trying to do this for their browser, there wasn't really a
portable way of altering the name that appeared in 'ps' short of execing
a new process (and this was only across Unix variants).

So your solution works on Linux, but other Unix variants will have a
"mileage may vary" problem. :)

Malcolm

-- 
Honk if you love peace and quiet.




More information about the Python-list mailing list