Open medined opened 3 months ago
I have verified that if my original comment is \x00 then the triple comment is maintained.
The issue lies in the following code in string_expr.py:
try:
if eval(fancy) == s and '\r' not in fancy:
return fancy
except Exception:
pass
The "source code string cannot contain null bytes" is swallowed. This took me about 4 hours to find. Please send the exception to an error log.
I recommend adding the following immediately before the try statement. It's not ideal to change incoming text, but the alternative is that aster is not reliable. This whole issue arose because the OpenDevin project references binary characters in at least one docstring.
s = s.replace('\x00', '\\x00')
I am using ast to parse a python file. Then using astor to print a specific function. When the function has the following docstring
it is converted to
by astor.
This causes the python code to fail pylint because the docstring is no longer correct.
P.S. The \x00 in the python comment is part of a longer comment that discusses binary data.