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 NetAlien
Recipients NetAlien
Date 2022-01-07.23:22:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1641597759.71.0.591724063363.issue46302@roundup.psfhosted.org>
In-reply-to
Content
var = "u2"
var.strip()[0] 
Works as expected, except that it returns IndexError (instead of "u") if used in a list comprehension -- at least, that's where I found it.  Attached example script illustrates the issue.
Call it with "mytest N" where N is 1 (fails), 2 (works), 3 (fails).
mytest 1 -- KeyError expected; this was due to infile design change
            adding a digit to previously single char code
mytest 2 -- workaround to actual issue in next test
mytest 3 -- adding [0] fails when used in list comprehension
History
Date User Action Args
2022-01-07 23:22:39NetAliensetrecipients: + NetAlien
2022-01-07 23:22:39NetAliensetmessageid: <1641597759.71.0.591724063363.issue46302@roundup.psfhosted.org>
2022-01-07 23:22:39NetAlienlinkissue46302 messages
2022-01-07 23:22:39NetAliencreate