Hi... Here's a weird problem...I'm trying to escape a bunch of data to put into a database.
Here's what I have: def escape(string): """ Escape both single quotes and blackslashes >>> x = r"fun\fun" >>> escape(x) 'fun\\\\fun' """ string = string.replace('\\', '\\\\') return string Now the commands in the doctest work when I type them by hand into the python interpreter! >>> x = r"fun\fun" >>> escape(x) 'fun\\\\fun' But they don't work when I actually run them with doctest: Failed example: escape(x) Expected: 'fun\\fun' Got: 'fun\x0cun' Why? Thanks! -- http://mail.python.org/mailman/listinfo/python-list