summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authort0b3 <thomas.bettler@gmail.com>2020-06-22 20:29:08 +0200
committert0b3 <thomas.bettler@gmail.com>2020-06-22 20:34:31 +0200
commit466518ed6f74b6cef3b79aa8a917be3c7184284a (patch)
treea52a52768434053f4404c5160a215ef3f3fdcfe8
parentf69df4252e3a8466c025e34585dac37c7691b47c (diff)
downloadrdflib-466518ed6f74b6cef3b79aa8a917be3c7184284a.tar.gz
fix escaping (deprecated since py 3.6)
Signed-off-by: t0b3 <thomas.bettler@gmail.com>
-rw-r--r--examples/film.py2
-rw-r--r--rdflib/compat.py2
-rw-r--r--rdflib/paths.py2
-rw-r--r--rdflib/plugins/sparql/parser.py2
-rw-r--r--rdflib/plugins/stores/sparqlstore.py2
-rw-r--r--rdflib/tools/csv2rdf.py2
6 files changed, 6 insertions, 6 deletions
diff --git a/examples/film.py b/examples/film.py
index 0c566fd3..bf2d5e0b 100644
--- a/examples/film.py
+++ b/examples/film.py
@@ -42,7 +42,7 @@ storeuri = "file://" + storefn
title = "Movies viewed by %s"
r_who = re.compile(
- "^(.*?) <([a-z0-9_-]+(\.[a-z0-9_-]+)*@[a-z0-9_-]+(\.[a-z0-9_-]+)+)>$"
+ r"^(.*?) <([a-z0-9_-]+(\.[a-z0-9_-]+)*@[a-z0-9_-]+(\.[a-z0-9_-]+)+)>$"
)
IMDB = Namespace("http://www.csd.abdn.ac.uk/~ggrimnes/dev/imdb/IMDB#")
diff --git a/rdflib/compat.py b/rdflib/compat.py
index 17784704..a2194ac0 100644
--- a/rdflib/compat.py
+++ b/rdflib/compat.py
@@ -95,7 +95,7 @@ if narrow_build:
def decodeStringEscape(s):
- """
+ r"""
s is byte-string - replace \ escapes in string
"""
diff --git a/rdflib/paths.py b/rdflib/paths.py
index d2fccd22..ee5d0daa 100644
--- a/rdflib/paths.py
+++ b/rdflib/paths.py
@@ -1,4 +1,4 @@
-__doc__ = """
+__doc__ = r"""
This module implements the SPARQL 1.1 Property path operators, as
defined in:
diff --git a/rdflib/plugins/sparql/parser.py b/rdflib/plugins/sparql/parser.py
index acf473fc..e4e99853 100644
--- a/rdflib/plugins/sparql/parser.py
+++ b/rdflib/plugins/sparql/parser.py
@@ -1515,7 +1515,7 @@ expandUnicodeEscapes_re = re.compile(r"\\u([0-9a-f]{4}(?:[0-9a-f]{4})?)", flags=
def expandUnicodeEscapes(q):
- """
+ r"""
The syntax of the SPARQL Query Language is expressed over code points in Unicode [UNICODE]. The encoding is always UTF-8 [RFC3629].
Unicode code points may also be expressed using an \ uXXXX (U+0 to U+FFFF) or \ UXXXXXXXX syntax (for U+10000 onwards) where X is a hexadecimal digit [0-9A-F]
"""
diff --git a/rdflib/plugins/stores/sparqlstore.py b/rdflib/plugins/stores/sparqlstore.py
index fd2c1fe6..2d20c97c 100644
--- a/rdflib/plugins/stores/sparqlstore.py
+++ b/rdflib/plugins/stores/sparqlstore.py
@@ -22,7 +22,7 @@ LIMIT = "LIMIT"
OFFSET = "OFFSET"
ORDERBY = "ORDER BY"
-BNODE_IDENT_PATTERN = re.compile("(?P<label>_\:[^\s]+)")
+BNODE_IDENT_PATTERN = re.compile(r"(?P<label>_\:[^\s]+)")
def _node_to_sparql(node):
diff --git a/rdflib/tools/csv2rdf.py b/rdflib/tools/csv2rdf.py
index 664f262e..4c53beeb 100644
--- a/rdflib/tools/csv2rdf.py
+++ b/rdflib/tools/csv2rdf.py
@@ -100,7 +100,7 @@ def toProperty(label):
firstNm => firstNm
"""
- label = re.sub("[^\w]", " ", label)
+ label = re.sub("[^\\w]", " ", label)
label = re.sub("([a-z])([A-Z])", "\\1 \\2", label)
label = label.split(" ")
return "".join([label[0].lower()] + [x.capitalize() for x in label[1:]])