Message107998
Confirmed in trunk and py3k, both of which raise ValueError on the second compile:
Python 2.7rc1+ (trunk:82042, Jun 17 2010, 09:52:12)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import parser
>>> st = parser.expr("-3")
>>> st.compile()
<code object <module> at 0x450448, file "<syntax-tree>", line 1>
>>> st.compile()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: could not convert string to float: --3
This looks nasty; unless there's some rule that says that you're not supposed to hang on to AST objects after compiling them. (Is there?)
Benjamin, would it be worth just getting rid of this optimization for 2.7, and trying to reinstate a correct version for 2.7.1?
[Removing 2.5 from the versions list since there's nothing we can do about it there (2.5 is only getting security fixes at this point).]
See also issue 1441486. |
|
Date |
User |
Action |
Args |
2010-06-17 09:21:05 | mark.dickinson | set | recipients:
+ mark.dickinson, benjamin.peterson, alexhsamuel |
2010-06-17 09:21:05 | mark.dickinson | set | messageid: <1276766465.13.0.0737700482017.issue9011@psf.upfronthosting.co.za> |
2010-06-17 09:21:03 | mark.dickinson | link | issue9011 messages |
2010-06-17 09:21:02 | mark.dickinson | create | |
|