summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Car <nicholas.car@surroundaustralia.com>2022-01-13 08:58:12 +1000
committerGitHub <noreply@github.com>2022-01-13 08:58:12 +1000
commita6c5169f948823f6651745ba2d2fe781d0d5ecd2 (patch)
tree724627bb38f92513d4b39e28b39ae52d24391e32
parentd9575336024d135318ac2e6f7a11592675cb8c2f (diff)
parentfece4a533f7e58d900faa365a2f309cff09e554b (diff)
downloadrdflib-a6c5169f948823f6651745ba2d2fe781d0d5ecd2.tar.gz
Merge pull request #1660 from aucampia/iwana-20220110T2208-remove_narrow
Remove narrow build detection
-rw-r--r--rdflib/compat.py23
-rw-r--r--test/test_wide_python.py13
2 files changed, 0 insertions, 36 deletions
diff --git a/rdflib/compat.py b/rdflib/compat.py
index 6020a630..139f2428 100644
--- a/rdflib/compat.py
+++ b/rdflib/compat.py
@@ -5,7 +5,6 @@ and different versions of support libraries.
import re
import codecs
-import warnings
import typing as t
if t.TYPE_CHECKING:
@@ -59,28 +58,6 @@ def _unicodeExpand(s):
return r_unicodeEscape.sub(lambda m: chr(int(m.group(0)[2:], 16)), s)
-narrow_build = False
-try:
- chr(0x10FFFF)
-except ValueError:
- narrow_build = True
-
-if narrow_build:
-
- def _unicodeExpand(s):
- try:
- return r_unicodeEscape.sub(lambda m: chr(int(m.group(0)[2:], 16)), s)
- except ValueError:
- warnings.warn(
- "Encountered a unicode char > 0xFFFF in a narrow python build. "
- "Trying to degrade gracefully, but this can cause problems "
- "later when working with the string:\n%s" % s
- )
- return r_unicodeEscape.sub(
- lambda m: codecs.decode(m.group(0), "unicode_escape"), s
- )
-
-
def decodeStringEscape(s):
r"""
s is byte-string - replace \ escapes in string
diff --git a/test/test_wide_python.py b/test/test_wide_python.py
deleted file mode 100644
index ad5421d4..00000000
--- a/test/test_wide_python.py
+++ /dev/null
@@ -1,13 +0,0 @@
-def test_wide_python_build():
- """This test is meant to fail on narrow python builds (common on Mac OS X).
-
- See https://github.com/RDFLib/rdflib/issues/456 for more information.
- """
- assert len("\U0010FFFF") == 1, (
- "You are using a narrow Python build!\n"
- "This means that your Python does not properly support chars > 16bit.\n"
- 'On your system chars like c=u"\\U0010FFFF" will have a len(c)==2.\n'
- "As this can cause hard to debug problems with string processing\n"
- "(slicing, regexp, ...) later on, we strongly advise to use a wide\n"
- "Python build in production systems."
- )