[Python-bugs-list] [ python-Bugs-422678 ] argv is modified in Py_Main()

noreply@sourceforge.net noreply@sourceforge.net
Wed, 09 May 2001 08:50:53 -0700


Bugs item #422678, was updated on 2001-05-09 08:50
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422678&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Frederic Giacometti (giacometti)
Assigned to: Nobody/Anonymous (nobody)
Summary: argv is modified in Py_Main()

Initial Comment:
Context: Python 2.1 release

In function Py_Main( argc, argv), @[file main.c, line 287], argv is modified: 		
'argv[_PyOS_optind] = "-c";'

argv[] should remain constant, and should not be modified; I am getting a coredump when cleaning 
up the contents of argv[] in the calling process...

If you feel you need to modify argv[]; a copy of the array should be made at the beginning of 
Py_Main(), and then work/modify the copy; not the original !!!

Meanwhile, I'll pass a copy of argv to Py_Main(), and will clean up the original!!

FG


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422678&group_id=5470