Index: PyString.java =================================================================== --- PyString.java (revision 6942) +++ PyString.java (working copy) @@ -153,8 +153,8 @@ for (int i = 0; size-- > 0; ) { int ch = str.charAt(i++); - /* Escape quotes */ - if (use_quotes && (ch == quote || ch == '\\')) { + /* Escape quotes and backslashes */ + if ((use_quotes && ch == quote) || ch == '\\') { v.append('\\'); v.append((char) ch); continue;