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.

classification
Title: sys.argv should always be a sequence
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: jhylton Nosy List: jhylton, smcinerney
Priority: low Keywords:

Created on 2001-04-03 04:56 by smcinerney, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Messages (2)
msg4156 - (view) Author: Stephen McInerney (smcinerney) Date: 2001-04-03 04:56
Hi,

It seems that sys.argv is not a sequence if there are
no args passed. Hence references to len() or
non-existent element sys.argv[1] cause a TypeError
which we have to kludge around with a try...except
TypeError. sys.argv should always be a sequence.

Python 1.6 (#4, Sep 13 2000, 17:24:07)  [GCC
egcs-2.91.66 19990314 (egcs-1.1.2 release)] on sunos5
(Solaris 8)

Best regards,
Stephen
msg4157 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2001-04-04 18:04
Logged In: YES 
user_id=31392

Can you provide an example of how you invoke Python with no
args and what value sys.argv[] has?  I can't reproduce.
History
Date User Action Args
2022-04-10 16:03:55adminsetgithub: 34268
2001-04-03 04:56:55smcinerneycreate