Re: ANNOUNCE; Try python beta
[Richie][color=blue]
> I think it's your JavaScript '\r' processing that's broken. Certainly the
> error ("unexpected EOF while parsing") is consistent with having a \r on the
> end of the expression.[/color]
[Mike][color=blue]
> Python doesn't care about the trailing newline.[/color]
That's a carriage return, not a newline:
[color=blue][color=green][color=darkred]
>>> eval("1+2\r")[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 1
1+2
^
SyntaxError: unexpected EOF while parsing
[color=blue]
> My assumption is that if splitting on '\n' leaves us with one
> thing, we may have gotten a string that used \r for newlines[/color]
Ah, OK. Your comment talks about DOS - that won't happen on DOS (or
Windows) which uses \r\n. I don't know about the Mac. But the \r\n pair
isn't handled by your code - strip() on the server side will make it work if
that's the problem:
[color=blue][color=green][color=darkred]
>>> eval("1+2\r".st rip())[/color][/color][/color]
3
--
Richie Hindle
richie@entrian. com
[Richie][color=blue]
> I think it's your JavaScript '\r' processing that's broken. Certainly the
> error ("unexpected EOF while parsing") is consistent with having a \r on the
> end of the expression.[/color]
[Mike][color=blue]
> Python doesn't care about the trailing newline.[/color]
That's a carriage return, not a newline:
[color=blue][color=green][color=darkred]
>>> eval("1+2\r")[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 1
1+2
^
SyntaxError: unexpected EOF while parsing
[color=blue]
> My assumption is that if splitting on '\n' leaves us with one
> thing, we may have gotten a string that used \r for newlines[/color]
Ah, OK. Your comment talks about DOS - that won't happen on DOS (or
Windows) which uses \r\n. I don't know about the Mac. But the \r\n pair
isn't handled by your code - strip() on the server side will make it work if
that's the problem:
[color=blue][color=green][color=darkred]
>>> eval("1+2\r".st rip())[/color][/color][/color]
3
--
Richie Hindle
richie@entrian. com
Comment