Comment 2 for bug 175898

Revision history for this message
Christian Theune (ctheune) wrote : Re: [Bug 175898] Solution!

Interesting. Looks weird as a solution anyway. :/ I'll try to digg up
where this comes from really.

Am Freitag, den 14.12.2007, 16:05 +0000 schrieb peterbe:
> The patch is dumb-easy but made all the difference. This is simply a
> standard Python "limitation":
>
> peterbe@trillian:/tmp $ python2.4
> Python 2.4.4 (#2, Apr 12 2007, 21:03:11)
> [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> filename = 'UserCookies.py'
> >>> source = open(filename).read()
> >>> print str(repr(source))[-50:]
> n self._del_usercookie(uid, key)\n '
> >>> compile(source, filename, 'exec')
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "UserCookies.py", line 29
>
> SyntaxError: invalid syntax
> >>> compile(source.strip()+'\n', filename, 'exec')
> <code object ? at 0xb79ee120, file "UserCookies.py", line 1>
>
>
> ** Attachment added: "xreload.py.patch"
> http://launchpadlibrarian.net/10904139/xreload.py.patch
>
--
gocept gmbh & co. kg - forsterstrasse 29 - 06112 halle (saale) - germany
www.gocept.com - <email address hidden> - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development