durusmail: quixote-users: Re: Syntax error if .ptl ends with whitespaces
Syntax error if .ptl ends with whitespaces
2004-07-06
2004-07-06
Re: Syntax error if .ptl ends with whitespaces
2004-07-06
Re: R: [Quixote-users] Syntax error if .ptl ends with whitespaces
Re: Syntax error if .ptl ends with whitespaces
Graham Fawcett
2004-07-06
Graham Fawcett wrote:

> Yes, I can replicate the error. Using quixote 1.0 on python 2.3.3
> (win32), the following test program:
>
>    from quixote import enable_ptl
>    enable_ptl()
>
>    f = file('foo.ptl', 'w')
>    f.write('def hello [html] ():\n    "Hi there."\n    ')
>    f.close()
>    import foo
>
> raises a SyntaxError: invalid syntax on line 3 of foo.ptl (the empty line).
>
> The following change to ptl_compile may be necessary. It may also be
> overkill: I assume that this problem is occuring on win32 only, but
> haven't tested elsewhere, and haven't checked for bug reports on the
> Python tracker.

Oops, no -- I was able to generate the same exception on Linux too:
Quixote 1.0 with Python 2.3.3 on Fedora Core 2. Ignore my earlier patch...

-- Graham


reply