diff --git a/alembic/util/pyfiles.py b/alembic/util/pyfiles.py index fc9ef6e5..67c5396e 100644 --- a/alembic/util/pyfiles.py +++ b/alembic/util/pyfiles.py @@ -46,6 +46,8 @@ def template_to_file( ) else: with open(dest, "ab" if append else "wb") as f: + if append: + f.write(b"\n\n") f.write(output) diff --git a/docs/build/unreleased/1679.rst b/docs/build/unreleased/1679.rst new file mode 100644 index 00000000..26009ba4 --- /dev/null +++ b/docs/build/unreleased/1679.rst @@ -0,0 +1,7 @@ + .. change:: + :tags: bug, command + :tickets: 1679 + + Updated ``utils.pyfiles.template_to_file`` to write two newlines before + the template file data in ``append``` mode. +