From b167af309185c04815c07271b7f8ed8db1d485db Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 1 Dec 2013 20:37:02 +0000 Subject: Open files in binary mode --- tests/docx/docx_tests.py | 2 +- tests/mammoth_tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/docx/docx_tests.py b/tests/docx/docx_tests.py index 15bca51..ea69dc2 100644 --- a/tests/docx/docx_tests.py +++ b/tests/docx/docx_tests.py @@ -8,7 +8,7 @@ from ..testing import test_path class ReadTests(object): @istest def can_read_document_with_single_paragraph_with_single_run_of_text(self): - with open(test_path("single-paragraph.docx")) as fileobj: + with open(test_path("single-paragraph.docx"), "rb") as fileobj: result = docx.read(fileobj=fileobj) expected_document = documents.document([ documents.paragraph([ diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py index 4550d91..d1492b3 100644 --- a/tests/mammoth_tests.py +++ b/tests/mammoth_tests.py @@ -7,7 +7,7 @@ import mammoth @istest def docx_containing_one_paragraph_is_converted_to_single_p_element(): - with open(test_path("single-paragraph.docx")) as fileobj: + with open(test_path("single-paragraph.docx"), "rb") as fileobj: result = mammoth.convert_to_html(fileobj=fileobj) assert_equal("

Walking on imported air

", result.value) assert_equal([], result.messages) -- cgit v1.2.3