[Zope] string index out of range

Justin Dunsworth justin.dunsworth at gmail.com
Tue Nov 24 22:37:20 EST 2009


On Tue, Nov 24, 2009 at 8:47 PM, Tres Seaver <tseaver at palladion.com> wrote:

>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Justin Dunsworth wrote:
> > I have been using Zope 2.10.4-final, python 2.4.4, win32 for quite
> awhile...
> > I recently started a new project using Zope 2.11.4-final, python 2.4.4,
> > win32 and proceeded with my normal programming but I am receiving an
> error
> > that I haven't received before.
> >
> > Traceback (innermost last):
> >   Module ZPublisher.Publish, line 119, in publish
> >   Module ZPublisher.mapply, line 88, in mapply
> >   Module ZPublisher.Publish, line 42, in call_object
> >   Module OFS.DTMLDocument, line 145, in __call__
> >    - <DTMLDocument at /gldb_root/processlogin>
> >    - URL: http://localhost/processlogin/manage_main
> >    - Physical Path: /gldb_root/processlogin
> >   Module zope.contenttype, line 76, in guess_content_type
> >   Module zope.contenttype, line 39, in text_type
> > IndexError: string index out of range
> >
> > I did a little deductive reasoning and took parts out until it didn't
> error
> > out anymore and it seemed when I took the following lines out it didn't
> > error:
> >
> > <dtml-call "RootSQLMethods.user.SetLastLogin(_.None,_)">
> > <dtml-call "RESPONSE.redirect(BASE1+'/')">
> >
> > If I have both, one, or the other in it will throw the error. If I take
> both
> > of these out then it will not.
> >
> > Any assistance is appreciated... if I need to provide more information
> > please let me know.
>
> The traceback would indicate that the DTMLDocumet at
> '/gldb_rootprocesslogin' is the culprit here.  We can't help you unless
> you provide the text of that method, along with the values it uses from
> the request (dummies would work, likely).
>
>
> Tres.
> - --
> ===================================================================
> Tres Seaver          +1 540-429-0999          tseaver at palladion.com
> Palladion Software   "Excellence by Design"    http://palladion.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAksMmtAACgkQ+gerLs4ltQ7N5ACfWyrBWl/ZbpwKR8i1IaCzzbrl
> Vo8AnjRIFPPKiK4+KKkePitnYIfbVtEd
> =KRRU
> -----END PGP SIGNATURE-----
>
>
I found out that there was a bug fix from 2.10.4 to 2.11.4 that if the
document type is plain text (no html headers) and if it has 14 character
whitespace at the beginning an error will be thrown. The way I had
processlogin document set up is to act as a redirect that captures some
details about the user and stores it into the database then redirects to the
member index. However, since I didn't add any HTML headers it treated it as
a plain text document and since it was way down on the list there was a ton
of whitespaces... and thus the error.

I got some help in IRC to figure this out and I had forgotten to respond
saying I got it fixed here...

Thanks for the assistance, though!
Justin Dunsworth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20091124/344624aa/attachment.html 


More information about the Zope mailing list