[zope2-tracker] [Bug 487998] Re: text_type can give IndexError: string index out of range in zope 2.11 & 2.12

Andrew P. Ho aho at ucla.edu
Tue Mar 23 20:47:55 EDT 2010


Here is a solution applied to
lib/python2.6/site-packages/zope.contenttype-3.4.2-py2.6.egg/zope/contenttype/__init__.py

*** Please incorporate into next Zope 2 release ***
--------
   # at least the maximum length of any tags we look for
    iMAXLEN=14
    if len(s) < iMAXLEN: return 'text/plain'
    i = 0

# here is the fix starting line 39
    try:
        while s[i] in string.whitespace:
         i += 1
    except IndexError:
         i=i-1

-- 
text_type can give IndexError: string index out of range in zope 2.11 & 2.12
https://bugs.launchpad.net/bugs/487998
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.


More information about the zope2-tracker mailing list