[Patches] [ python-Patches-664192 ] 661913: inconsistent error messages between string an unicod
SourceForge.net
noreply@sourceforge.net
Tue, 14 Jan 2003 21:37:08 -0800
Patches item #664192, was opened at 2003-01-08 00:27
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=664192&group_id=5470
Category: Core (C code)
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Christopher Blunck (blunck2)
Assigned to: Raymond Hettinger (rhettinger)
Summary: 661913: inconsistent error messages between string an unicod
Initial Comment:
'a'.index('b'): substring not found in index
u'a'.index('b'): substring not found (bah!)
same thing follows for rindex.
changed unicodeobject.c to return same error message as
what string returns.
----------------------------------------------------------------------
>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-01-15 00:37
Message:
Logged In: YES
user_id=80475
Fixed.
See /Objects/stringobject.c 2.204.
Thanks for the patch.
----------------------------------------------------------------------
Comment By: Christopher Blunck (blunck2)
Date: 2003-01-08 16:08
Message:
Logged In: YES
user_id=531881
Probably a good idea inyeol. Will post a follow-up patch
tonight. Thanks.
----------------------------------------------------------------------
Comment By: Inyeol Lee (inyeol)
Date: 2003-01-08 13:45
Message:
Logged In: YES
user_id=595280
Hmm... I think the patch should be in the
opposite direction - leaving unicode message
as is and fix stringobject.c to make the
message the same as unicode. I've scanned
all the exception messages in string methods
and (r)index() is the only method which contains
method name in its exception message. For example,
>>> 'a'.split('')
ValueError: empty separator
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=664192&group_id=5470