This seems related to code into profiler.py (2.4, 2.5, 2.6 all applies)
around line 607:

    (options, args) = parser.parse_args()
    sys.argv[:] = args

    if (len(sys.argv) > 0):
        sys.path.insert(0, os.path.dirname(sys.argv[0]))
        run('execfile(%r)' % (sys.argv[0],), options.outfile, options.sort)
    else:
        parser.print_usage()
    return parser


"sys.argv" variable is substituted with "args" coming from parse_args, and it 
doesn't contains original sys.argv[0] necessary for print_usage in case new 
args after options (provided by command_line) are not present.

Imho, that sys.argv substitution should be inside "if" statement see
(attached patch), let me know if it is correct to you.

thanks

** Attachment added: "python-profiler-2.6-sysargv.patch"
   http://launchpadlibrarian.net/29807251/python-profiler-2.6-sysargv.patch

** Attachment removed: "python-profiler-2.6-sysargv.patch"
   http://launchpadlibrarian.net/29807251/python-profiler-2.6-sysargv.patch

-- 
python2.6 crashed with IndexError in get_prog_name()
https://bugs.launchpad.net/bugs/361318
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to