Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Very cool! In this case, since the injected text will end in a newline, that approach will work (and it appears to work with r"""triple-quoted\'s"""

But I do see syntax errors if the bare slash is at the end:

    >>> r'slash at end\'
      File "<stdin>", line 1
        r'slash at end\'
                   ^
    SyntaxError: EOL while scanning string literal


Yeah, that's about the only restriction. From the docs:

Specifically, a raw string cannot end in a single backslash (since the backslash would escape the following quote character).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: