Issue1158

classification
Title: compile() fails to recognize initial AST arg
Type: Severity: normal
Components: Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: certik, fwierzbicki
Priority: Keywords:

Created on 2008-10-26.21:35:12 by certik, last changed 2008-10-28.20:37:18 by fwierzbicki.

Messages
msg3702 (view) Author: Ondrej Certik (certik) Date: 2008-10-26.21:35:11
$ cat v.py 
from ast import PyCF_ONLY_AST

def parse(expr, filename='<unknown>', mode='exec'):
    return compile(expr, filename, mode, PyCF_ONLY_AST)

a = parse("1/2")
e = compile(a, "<string>", 'exec')
print e


$ jython v.py 
Traceback (most recent call last):
  File "v.py", line 7, in <module>
    e = compile(a, "<string>", 'exec')
  File "<string>", line 1
	<javainstance object at 1>
	^
SyntaxError: line 1:0 mismatched input '<' expecting EOF (<string>, line 1)
msg3704 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-10-27.13:20:08
Fixed in r5517
msg3705 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-10-27.14:56:55
updated in r5518 based on some java integration changes that I just
missed in r5516.
msg3712 (view) Author: Ondrej Certik (certik) Date: 2008-10-28.14:06:18
Thanks a lot Frank for fixing this. 

Shouldn't you also commit a test for it?
msg3713 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-10-28.15:37:42
I did put in a new unit test, though I forgot to check it in with the
original fix.  I remembered a few minutes later -- see r5519 or just
look at the new test_ast_jy.py which contains a single test for this
issue.  Thanks again for reporting it!
msg3714 (view) Author: Ondrej Certik (certik) Date: 2008-10-28.15:47:42
Ah, excellent. Thanks a lot for fixing it.

In case you are bored, there is another problem, that we need to get
sympy running on top of jython: 

http://bugs.jython.org/issue1159

:)
msg3718 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-10-28.20:37:18
Heh -- I have a couple of things ahead of #1159, but if it is still
there in a day or two I'll definitely take a look.
History
Date User Action Args
2008-10-28 20:37:18fwierzbickisetmessages: + msg3718
2008-10-28 15:47:42certiksetmessages: + msg3714
2008-10-28 15:37:43fwierzbickisetmessages: + msg3713
2008-10-28 14:06:18certiksetmessages: + msg3712
2008-10-27 14:56:55fwierzbickisetmessages: + msg3705
2008-10-27 13:20:09fwierzbickisetstatus: open -> closed
resolution: fixed
messages: + msg3704
2008-10-27 13:19:02fwierzbickisettitle: compile() fails -> compile() fails to recognize initial AST arg
2008-10-27 00:57:18fwierzbickisetassignee: fwierzbicki
nosy: + fwierzbicki
2008-10-26 21:35:12certikcreate