aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/strutils.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-07-25 15:16:16 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-07-25 15:16:16 -0700
commit79ebcb046e8669f80357a6c3046ec76c6adf49be (patch)
tree441981a16f1be1e620584e4a47f41767ce5585b2 /netlib/strutils.py
parent3254595584e1d711e7ae292ad34753a52f7a0fc1 (diff)
parent56796aeda25dda66621ce78af227ff46049ef811 (diff)
downloadmitmproxy-79ebcb046e8669f80357a6c3046ec76c6adf49be.tar.gz
mitmproxy-79ebcb046e8669f80357a6c3046ec76c6adf49be.tar.bz2
mitmproxy-79ebcb046e8669f80357a6c3046ec76c6adf49be.zip
Merge remote-tracking branch 'origin/master' into flow_editing_v2
Diffstat (limited to 'netlib/strutils.py')
-rw-r--r--netlib/strutils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/netlib/strutils.py b/netlib/strutils.py
index 32e77927..8f27ebb7 100644
--- a/netlib/strutils.py
+++ b/netlib/strutils.py
@@ -51,8 +51,7 @@ else:
def escape_control_characters(text, keep_spacing=True):
"""
- Replace all unicode C1 control characters from the given text with their respective control pictures.
- For example, a null byte is replaced with the unicode character "\u2400".
+ Replace all unicode C1 control characters from the given text with a single "."
Args:
keep_spacing: If True, tabs and newlines will not be replaced.
@@ -99,6 +98,9 @@ def bytes_to_escaped_str(data, keep_spacing=False):
def escaped_str_to_bytes(data):
"""
Take an escaped string and return the unescaped bytes equivalent.
+
+ Raises:
+ ValueError, if the escape sequence is invalid.
"""
if not isinstance(data, six.string_types):
if six.PY2: