You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see that at File "/home/marko/workspace/pqryopen/icontract/venv3/lib/python3.5/site-packages/meta/decompiler/expression_mutator.py", line 39, in generic_visit you don't check for bytes, only for strings:
Hi @srossross ,
I've just started with this issue. However, I'm quite confused with the compatibility between Python 2 and 3 and how Meta was meant to resolve it. Namely, when I write a unit test in meta/decompiler/tests/test_simple.py:
AssertionError: Ast Not Equal:
Generated: "Module(body=[Expr(value=b'')])\n"
Expected: "Module(body=[Expr(value=Bytes(s=b''))])\n"
If I am correct, this is due to Python 2 versus Python 3 handling of bytes? Is the test suite intended to generate expressions of Python 2 or Python 3?
Hi,
I've just encountered a serious bug with Python 3. Namely, the byte constants are not decompiled correctly.
The string constants are decompiled correctly:
However, when I run the similar example with the bytes:
I see that at
File "/home/marko/workspace/pqryopen/icontract/venv3/lib/python3.5/site-packages/meta/decompiler/expression_mutator.py", line 39, in generic_visit
you don't check for bytes, only for strings:This is a bit of a blocker for us since we need meta in our library icontract to impose contract validations (pre- and post-conditions).
I tried changing the
generic_visit
in expression mutator to:And that seems to work.
I'd like to fix the issue and make a pull request, but before I go forward with it, could you please explain me:
pdb
locally imported followed by a callpdb.set_trace()
?_ast.Str
?Thaks for looking into this!
The text was updated successfully, but these errors were encountered: