Tanaka Akira <a...@fsij.org> added the comment:

src/if_python.c in vim-7.2 has a comment:
/* Set sys.argv[] to avoid a crash in warn(). */

I think the crash is follows.

% python
Python 2.5.2 (r252:60911, Jan  4 2009, 17:40:26) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> warnings.warn("foo")
__main__:1: UserWarning: foo
>>> import sys
>>> sys.argv
['']
>>> sys.argv = []
>>> sys.argv
[]
>>> warnings.warn("foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/warnings.py", line 54, in warn
    filename = sys.argv[0]
IndexError: list index out of range
>>>

----------
nosy: +akr

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5753>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to