From 2d126a00aebbbe224ee3721aac6117f598fc339f Mon Sep 17 00:00:00 2001 From: ines Date: Sat, 19 Aug 2017 22:32:07 +0200 Subject: [PATCH 1/2] Fix typo --- spacy/compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/compat.py b/spacy/compat.py index 7e69f3a61..3ed777154 100644 --- a/spacy/compat.py +++ b/spacy/compat.py @@ -109,7 +109,7 @@ def import_file(name, loc): if is_python2: return imp.load_source(name, loc) else: - spec = importlib.util.spec_from_file_location(name, str(init_file)) + spec = importlib.util.spec_from_file_location(name, str(loc)) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module From 281e7e58b30efe66dee888d3b3a1791309c60396 Mon Sep 17 00:00:00 2001 From: ines Date: Sat, 19 Aug 2017 22:32:16 +0200 Subject: [PATCH 2/2] Don't escape forward slashes on ujson.dumps --- spacy/compat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/compat.py b/spacy/compat.py index 3ed777154..e6b7c066b 100644 --- a/spacy/compat.py +++ b/spacy/compat.py @@ -51,7 +51,7 @@ if is_python2: unicode_ = unicode basestring_ = basestring input_ = raw_input - json_dumps = lambda data: ujson.dumps(data, indent=2).decode('utf8') + json_dumps = lambda data: ujson.dumps(data, indent=2, escape_forward_slashes=False).decode('utf8') path2str = lambda path: str(path).decode('utf8') elif is_python3: @@ -60,7 +60,7 @@ elif is_python3: unicode_ = str basestring_ = str input_ = input - json_dumps = lambda data: ujson.dumps(data, indent=2) + json_dumps = lambda data: ujson.dumps(data, indent=2, escape_forward_slashes=False) path2str = lambda path: str(path)