[Python-Dev] [Python-checkins] cpython: Fix PyUnicode_Substring() for start >= length and start (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Thu May 3 02:53:38 CEST 2012
- Previous message: [Python-Dev] outdated info on download pages for older versions
- Next message: [Python-Dev] [Python-checkins] cpython: Fix PyUnicode_Substring() for start >= length and start > end
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, May 3, 2012 at 10:33 AM, victor.stinner <python-checkins at python.org> wrote:
+ if (start >= length || end < start) { + assert(end == length); + return PyUnicodeNew(0, 0); + }
That assert doesn't look right.
Consider:
"abc"[4:1]
Unless I'm missing something, "end" will be 1, but "length" will be 3
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] outdated info on download pages for older versions
- Next message: [Python-Dev] [Python-checkins] cpython: Fix PyUnicode_Substring() for start >= length and start > end
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]