Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
chr(92) is a single backspace character ('\\'). Since backspace has special meaning in the replacement string, it should be escaped. re.sub(r'\\\\', r'\\', stringy_thingy) ---------- nosy: +serhiy.storchaka stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35072> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com