Skip to content

Commit b4fedcd

Browse files
committed
[test/doc] Fix windows urllib local file loading
1 parent 591deaa commit b4fedcd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/test_doc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import datetime
22
import os
33
import unittest
4+
try:
5+
from urllib.request import pathname2url
6+
except ImportError:
7+
from urllib import pathname2url
48

59
from odml import Document, Section, Property
610
from odml.doc import BaseDocument
@@ -93,7 +97,7 @@ def test_get_terminology_equivalent(self):
9397
dir_path = os.path.dirname(os.path.realpath(__file__))
9498
repo_file = os.path.join(dir_path, "resources",
9599
"local_repository_file_v1.1.xml")
96-
local_url = "file://%s" % repo_file
100+
local_url = "file://%s" % pathname2url(repo_file)
97101

98102
doc = Document(repository=local_url)
99103

0 commit comments

Comments
 (0)