This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author akr
Recipients akr, barry, benjamin.peterson, glyph, gregory.p.smith, iankko, loewis, pitrou, psss
Date 2009-06-24.23:40:15
SpamBayes Score 7.71605e-15
Marked as misclassified No
Message-id <1245886817.47.0.600954363755.issue5753@psf.upfronthosting.co.za>
In-reply-to
Content
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
>>>
History
Date User Action Args
2009-06-24 23:40:17akrsetrecipients: + akr, loewis, barry, gregory.p.smith, pitrou, benjamin.peterson, glyph, psss, iankko
2009-06-24 23:40:17akrsetmessageid: <1245886817.47.0.600954363755.issue5753@psf.upfronthosting.co.za>
2009-06-24 23:40:15akrlinkissue5753 messages
2009-06-24 23:40:15akrcreate