diff --git a/influxdb/line_protocol.py b/influxdb/line_protocol.py index 25dd2ad7..ab129fea 100644 --- a/influxdb/line_protocol.py +++ b/influxdb/line_protocol.py @@ -60,8 +60,6 @@ def _convert_timestamp(timestamp, precision=None): def _escape_tag(tag): tag = _get_unicode(tag, force=True) return tag.replace( - "\\", "\\\\" - ).replace( " ", "\\ " ).replace( ",", "\\," @@ -82,7 +80,6 @@ def _escape_tag_value(value): def quote_ident(value): """Indent the quotes.""" return "\"{}\"".format(value - .replace("\\", "\\\\") .replace("\"", "\\\"") .replace("\n", "\\n")) @@ -90,7 +87,6 @@ def quote_ident(value): def quote_literal(value): """Quote provided literal.""" return "'{}'".format(value - .replace("\\", "\\\\") .replace("'", "\\'")) diff --git a/influxdb/tests/test_line_protocol.py b/influxdb/tests/test_line_protocol.py index 5b344990..1e3a4825 100644 --- a/influxdb/tests/test_line_protocol.py +++ b/influxdb/tests/test_line_protocol.py @@ -44,7 +44,7 @@ def test_make_lines(self): self.assertEqual( line_protocol.make_lines(data), - 'test,backslash_tag=C:\\\\,integer_tag=2,string_tag=hello ' + 'test,backslash_tag=C:\\,integer_tag=2,string_tag=hello ' 'bool_val=True,float_val=1.1,int_val=1i,string_val="hello!"\n' ) @@ -160,14 +160,14 @@ def test_quote_ident(self): """Test quote indentation in TestLineProtocol object.""" self.assertEqual( line_protocol.quote_ident(r"""\foo ' bar " Örf"""), - r'''"\\foo ' bar \" Örf"''' + r'''"\foo ' bar \" Örf"''' ) def test_quote_literal(self): """Test quote literal in TestLineProtocol object.""" self.assertEqual( line_protocol.quote_literal(r"""\foo ' bar " Örf"""), - r"""'\\foo \' bar " Örf'""" + r"""'\foo \' bar " Örf'""" ) def test_float_with_long_decimal_fraction(self):