Closed petrmachcz closed 4 years ago
Hi, thanks @petrmachcz for the heads-up & the guidance.
Works fine locally on mac, but unit tests fail for ubuntu. Will look into it tomorrow.
literal_eval()
has some limitations, like:
# works
eval("pd.util.testing.makeDataFrame().head(3)")
# doesn't work
ast.literal_eval("pd.util.testing.makeDataFrame().head(3)")
and
literal_eval("\r\t") #fails
I wrote a new module safe_eval to get around those limitations.
I just released v.0.2
to include this and some other improvements, see the release notes.
Cheers!
Using eval() for evaluating untrusted string from markdown text is big security issue.
Use safe literal_eval() for evaluating string literal.
https://docs.python.org/3/library/ast.html#ast.literal_eval