Hi, Here's my second attempt to fix the issue. I'll wait a few days for comments before merging, to try and avoid causing a bug like last time. It turns out the problem was deeper than just the :var argument, multiline strings in the body were also getting mangled. For example, this block had the same problem as the original report: #+begin_src python text = """a b c """ return text #+end_src #+RESULTS: : a : b : c My fix this time was to use functions from python.el to indent, and to detect whether we are in a string and shouldn't be indented. I also added a couple more unit tests, one for multiline strings, and one for the variable scope/assignment issue that Matt reported. Cheers, Jack