Skip to content

Commit 46ae127

Browse files
committed
tests: Read / write RDF files in binary mode
RDFLib handles the encoding. For some background information see RDFLib/rdflib#249
1 parent 302370d commit 46ae127

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_conversion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TestConversions(TestCase):
4646

4747
def parse_rdf_file(self, file_name):
4848
"""Returns tuple error, document."""
49-
with open(file_name, mode='r') as infile:
49+
with open(file_name, mode='rb') as infile:
5050
rdfparser = RDFParser(RDFBuilder(), StandardLogger())
5151
return rdfparser.parse(infile)
5252

@@ -62,7 +62,7 @@ def write_tagvalue_file(self, document, file_name):
6262
tvwriter.write_document(document, out)
6363

6464
def write_rdf_file(self, document, file_name):
65-
with open(file_name, mode='w') as out:
65+
with open(file_name, mode='wb') as out:
6666
rdfwriter.write_document(document, out)
6767

6868
def test_tagvalue_rdf(self):

0 commit comments

Comments
 (0)