From 7e01bb9fc2f4b1bebe010fb2359c07f6eca18824 Mon Sep 17 00:00:00 2001 From: Noa Resare Date: Mon, 17 Jul 2017 12:34:23 +0100 Subject: [PATCH] Fix invalid escape warning a literal string '\#' in python 3.6 causes a DeprecationWarning "invalid escape sequence" as there is no defined backslash escape that looks like that. This change changes the string to a raw string, which makes the intent clear. The text format for unknown RR types is defined in RFC3597 Section 5, and should indeed be the two ascii characters backslash (0x5c) followed by pound sign (0x23). --- dns/rdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/rdata.py b/dns/rdata.py index 5c6c34de..89b78492 100644 --- a/dns/rdata.py +++ b/dns/rdata.py @@ -274,7 +274,7 @@ class GenericRdata(Rdata): @classmethod def from_text(cls, rdclass, rdtype, tok, origin=None, relativize=True): token = tok.get() - if not token.is_identifier() or token.value != '\#': + if not token.is_identifier() or token.value != r'\#': raise dns.exception.SyntaxError( r'generic rdata does not start with \#') length = tok.get_int() -- 2.47.3