[Python-porting] main() -> Py_SetProgramName()

M.-A. Lemburg mal at egenix.com
Sat Dec 8 12:57:53 CET 2012


On 08.12.2012 10:40, Antoine Pitrou wrote:
> M.-A. Lemburg <mal at ...> writes:
>>
>> There's also another issue with the approach, since changing the
>> **argv from within Python is no longer possible on non-Windows
>> platforms.
>>
>> This doesn't only affect embedded uses of Python, but all other
>> uses as well, e.g. it's no longer possible to change the ps output
>> under Unix for daemons and the like.
> 
> setproctitle is your friend:
> http://pypi.python.org/pypi/setproctitle

Thanks for the pointer, but I think this is more than enough
proof that something should be done to make the situations in
Py3 easier for everyone.

Here's the hack he's using to find the original argv areas
by walking backwards from environ[0]...

https://github.com/dvarrazzo/py-setproctitle/blob/master/src/spt_setup.c#L139

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Dec 08 2012)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2012-12-05: Released eGenix pyOpenSSL 0.13 ...    http://egenix.com/go37
2012-11-28: Released eGenix mx Base 3.2.5 ...     http://egenix.com/go36
2013-01-22: Python Meeting Duesseldorf ...                 45 days to go

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-porting mailing list