Author baikie
Recipients baikie
Date 2008-06-01.22:22:06
SpamBayes Score 0.0105907
Marked as misclassified No
Message-id <1212358937.18.0.778474192325.issue3023@psf.upfronthosting.co.za>
In-reply-to
Content
The error message has no newline at the end:

$ LANG=en_GB.UTF-8 python3.0 test.py $'\xff'
Could not convert argument 2 to string$

Seriously, though: is this the intended behaviour?  If the
interpreter just dies when it gets a non-UTF-8 (or whatever)
argument, it creates an opportunity for a denial-of-service if
some admin is running a Python script via find(1) or similar.
And what if you want to run a Python script on some files named
in a mixture of charsets (because, say, you just untarred an
archive created in a foreign charset)?

Could sys.argv not provide bytes objects for those arguments,
like os.listdir()?  Or (better IMHO) have a separate
sys.argv_bytes interface?
History
Date User Action Args
2008-06-01 22:22:20baikiesetspambayes_score: 0.0105907 -> 0.0105907
recipients: + baikie
2008-06-01 22:22:17baikiesetspambayes_score: 0.0105907 -> 0.0105907
messageid: <1212358937.18.0.778474192325.issue3023@psf.upfronthosting.co.za>
2008-06-01 22:22:14baikielinkissue3023 messages
2008-06-01 22:22:09baikiecreate