Refactor strutil.unescape to handle use case separately
Refactor strutil.unescape to handle use cases like carriage return and double escape separately.
def unescape(s):
- return (s.replace('\r\n', '\n')
- if isinstance(s, basestring) else s)
+ if isinstance(s, basestring):
+ s = s.replace('\\n', '\n')
+ s = s.replace('\\r', '')
+ s = s.replace('\\"', '\"')
+ s = s.replace('\r', '')
+
+ return s
