Skip to content

Commit

Permalink
Read and write file in binary mode to remove BOM (Byte Order Mark) bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
arisktfx committed Oct 29, 2024
1 parent da3e7c2 commit bd92e21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openformats/formats/docx.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __init__(self, content):

def get_document(self):
if self.__document is None:
with io.open(self.__document_path, 'r') as f:
with io.open(self.__document_path, 'rb') as f:
self.__document = f.read()

return self.__document
Expand Down

0 comments on commit bd92e21

Please sign in to comment.