[ python-Bugs-839151 ] attempt to access sys.argv when it doesn't exist

SourceForge.net noreply at sourceforge.net
Mon Nov 10 10:02:15 EST 2003


Bugs item #839151, was opened at 2003-11-10 05:56
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=839151&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Bram Moolenaar (vimboss)
Assigned to: Nobody/Anonymous (nobody)
Summary: attempt to access sys.argv when it doesn't exist

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2003-11-10 10:02

Message:
Logged In: YES 
user_id=33168

Just to provide a reference, 839200 was a duplicate of this
report.  I closed 839200.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=839151&group_id=5470



More information about the Python-bugs-list mailing list