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 vimboss
Recipients
Date 2003-11-10.10:56:09
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
When using Python as an extension to another program,
giving a warning message attempts to access sys.argv
while it doesn't exist.

The problem can be reproduced with Vim when compiled
with Python 2.3.  Use these two commands:
    :py import sys
    :py print sys.maxint + 1

The problem is caused by the warnings module.  In line
53 it accesses sys.argv[0], but for an embedded
interpreter this doesn't exist.

The suggested fix does an explicit test for the
existence of sys.argv.  That seems to be the cleanest
solution to me.

This problem also existed in Python 2.2.  I didn't try
other versions.
History
Date User Action Args
2007-08-23 14:18:11adminlinkissue839151 messages
2007-08-23 14:18:11admincreate