diff --git a/toml/encoder.py b/toml/encoder.py index bf17a72..6fe32c4 100644 --- a/toml/encoder.py +++ b/toml/encoder.py @@ -95,7 +95,8 @@ def _dump_str(v): if singlequote: v = v.replace("\\'", "'") v = v.replace('"', '\\"') - v = v.split("\\x") + # split on \x, but not \\x + v = re.split(r"(? 1: i = -1 if not v[0]: