This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients alexhsamuel, benjamin.peterson, mark.dickinson
Date 2010-06-17.09:21:02
SpamBayes Score 2.0008049e-08
Marked as misclassified No
Message-id <1276766465.13.0.0737700482017.issue9011@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-06-17 09:21:05mark.dickinsonsetrecipients: + mark.dickinson, benjamin.peterson, alexhsamuel
2010-06-17 09:21:05mark.dickinsonsetmessageid: <1276766465.13.0.0737700482017.issue9011@psf.upfronthosting.co.za>
2010-06-17 09:21:03mark.dickinsonlinkissue9011 messages
2010-06-17 09:21:02mark.dickinsoncreate