-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] dumps() emits an extra EOL in the EOF after inserting a node if source code ends with if-block #190
Comments
webknjaz
added a commit
to webknjaz/redbaron
that referenced
this issue
Sep 25, 2019
Reproducer: #191 |
Oh, and I originally got hit this by doing |
webknjaz
added a commit
to webknjaz/collection_migration
that referenced
this issue
Jan 7, 2020
It's a workaround for PyCQA/redbaron#190
webknjaz
added a commit
to ansible-community/collection_migration
that referenced
this issue
Jan 16, 2020
It's a workaround for PyCQA/redbaron#190
webknjaz
added a commit
to webknjaz/collection_migration
that referenced
this issue
Jan 16, 2020
It's a workaround for PyCQA/redbaron#190
webknjaz
added a commit
to webknjaz/collection_migration
that referenced
this issue
Jan 16, 2020
It's a workaround for PyCQA/redbaron#190 Also: * Ensure there's LF @ rewritten module EOL
webknjaz
added a commit
to webknjaz/collection_migration
that referenced
this issue
Jan 16, 2020
It's a workaround for PyCQA/redbaron#190 Also: * Ensure there's LF @ rewritten module EOL
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So basically when I parse
src = '\nimport i1\nimport i2\n\nif True:\n pass\n
and dump immediately, it emits the same result as the source.But if I parse that and insert a root-level node, it adds an extra
\n
in the very end.The above returns
'\nimport i1\nimport i2\nimport i1\n\nif True:\n pass\n\n'
. (Note double LF in the end)I could only reproduce this with an if-block (if-else too), but other nested constructs (like
def
orwith
-block) are not affected by this bug.The text was updated successfully, but these errors were encountered: