Escaped-line-break confuses Python script debugger


#1

Hi,

Occasionally I use multi-line strings in my Python scripts like this:

_version_history_ = """\
1.0 : base
1.1 : fixed some bugs...
"""

Note the backslash at the end of the first line. It masks out the line break and lets me start the first line of the string on the left margin. So the “layout” is preserved in the editor and I don’t have an empty line in the string either.

If I set a breakpoint on a line somewhere behind this chunk the debugger does not stop at that line. (But maybe on the next or previous or so.)

This is fairly easy to prevent of course, just remove the backslash… If it’s easy to fix then I’d nevertheless appreciate this option.

Thanks,
Gero.

Update: Note that verbatim strings might be different again. I.e.

r"""Some docstring starts here. With a code example:
>>> tab = StringIO('''\
>>> x,y,z
>>> 1.0,0.5,0.2
>>> ''')
"""

(Note the small r at the very beginning.) In this case the backslash after StringIO occurs verbatim in the docstring. And the lines are not concatenated.
Btw. In this example to avoid the debugger issue you would have to put the x,y,z line right behind the opening quotes which wouldn’t be nice to read.