Repository navigation
Conversation
Unescaped messages containing triple quotes could close the module docstring early and leave the rest of the message as executable code when the revision is imported. Backslashes were also interpreted as escape sequences. Escape both before rendering script.py.mako.
|
Hi, and thanks for the pull request! This project accepts pull requests only for issues that a maintainer has already marked with the open for pull requests label. That way we can settle on an approach before anyone spends time writing code. This pull request references issue #1879, which hasn't been marked open for pull requests, so the change isn't authorized yet and I'm closing it automatically. Once a maintainer adds the label to #1879, reopen this pull request and it will stay open. If #1879 needs more detail before that can happen, a complete runnable example is usually the missing piece, and adding one to the issue is the fastest way to get there. This is automatic and procedural. It isn't a judgment on your change, and nothing you've written here is lost. Thanks for your interest in the project! |
Fixes #1879.
generate_revision()passed the revision message straight intoscript.py.mako, which embeds it in a triple-quoted module docstring. A message containing"""could close that docstring early so the remainder ran as Python when the revision was imported, and backslashes were interpreted as escape sequences soscript.docdid not round-trip.Escape backslashes and triple quotes in
_escape_docstring_message()before rendering (covers built-in templates and customscript.py.makocopies).Test
test_create_script_message_with_triple_quotestest_create_script_message_with_backslashesRevisionCommandTest::test_create_script_basicstill passes