From a91f762c3352b71eaa75238f7236d7bf2f685eb8 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 4 Oct 2018 00:53:39 +0100 Subject: [PATCH] docs: Write files in binary mode For python3, the mode for writing the file is required. Change-Id: Idc17e36bb88c786027c0d6476b54844ae5d7f81e --- doc/source/_exts/metadata-docs-rhel7.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/_exts/metadata-docs-rhel7.py b/doc/source/_exts/metadata-docs-rhel7.py index 547a0d33..f5a9b3fc 100755 --- a/doc/source/_exts/metadata-docs-rhel7.py +++ b/doc/source/_exts/metadata-docs-rhel7.py @@ -201,7 +201,7 @@ def write_file(filename, content): if not os.path.isdir(os.path.dirname(file_path)): os.makedirs(os.path.dirname(file_path)) - with open(file_path, 'w') as f: + with open(file_path, 'wb') as f: f.write(content.encode('utf-8')) return True