s.startswith(unicode) bug???

Erik Westra ewestra at wave.co.nz
Thu Oct 3 01:02:05 EDT 2002


Hi,

I'm running Python 2.2 (not 2.2.1) under Windows 2K, and have come
across the following bug.  I was wondering if someone with 2.2.1 could
please check if it still happens -- if so, I'll post a bug report to
the Python SourceForce site.

Under Python 2.2, if I evaluate:

    "a".startswith("a")

it correctly returns 1.  But if I change the substring to unicode,
like this:

    "a".startswith(u"a")

it returns 0!  If I then try:

    "ab".startswith(u"a")

it again returns 1.  Most weird!  This only happens with the substring
is in unicode rather than a normal string...

Thanks,

 - Erik.



More information about the Python-list mailing list