Amaury Forgeot d'Arc <amaur...@gmail.com> added the comment: Some remarks about the patch: 1 - this line causes a buffer overrun: strncpy(argv[0], name , strlen(name)); A possible solution is to do like posix_putenv(): have a static PyString that holds the memory, and just change the pointer argv[0]: argv[0] = PyString_AS_STRING(name);
2 - The function should update sys.argv as well. In this case, os.getprocname is not necessary. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5672> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com