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 nestor
Recipients aronacher, benjamin.peterson, georg.brandl, gpolo, mark.dickinson, nestor, rhettinger, terry.reedy
Date 2010-10-13.19:36:40
SpamBayes Score 9.738157e-06
Marked as misclassified No
Message-id <1286998602.58.0.486068120725.issue10091@psf.upfronthosting.co.za>
In-reply-to
Content
>>> import ast
>>> eval('{1:11,2:22}')
{1: 11, 2: 22}
>>> ast.literal_eval('{1:11,2:22}')
{1: 11, 2: 22}

>>> eval('{1,2}')
{1, 2}
>>> ast.literal_eval('{1,2}')
Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    ast.literal_eval('{1,2}')
  File "C:\Python31\lib\ast.py", line 80, in literal_eval
    return _convert(node_or_string)
  File "C:\Python31\lib\ast.py", line 79, in _convert
    raise ValueError('malformed string')
ValueError: malformed string

>>> 

I haven't tested for 2.7 or 3.2 but this bug probably applies also there.
History
Date User Action Args
2010-10-13 19:36:42nestorsetrecipients: + nestor, georg.brandl, rhettinger, terry.reedy, mark.dickinson, benjamin.peterson, gpolo, aronacher
2010-10-13 19:36:42nestorsetmessageid: <1286998602.58.0.486068120725.issue10091@psf.upfronthosting.co.za>
2010-10-13 19:36:40nestorlinkissue10091 messages
2010-10-13 19:36:40nestorcreate