summaryrefslogtreecommitdiffstats
path: root/packaging/release/changelogs/changelog.py
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2019-07-03 19:37:31 +0200
committerToshio Kuratomi <a.badger@gmail.com>2019-07-05 20:15:17 +0200
commitfed90efc4d95417160efb651e3393391bb2b247a (patch)
tree3b3ca1452f6c98dcbba47dfdca82efd78cffc7f7 /packaging/release/changelogs/changelog.py
parentCorrect machinectl become plugin function arguments (#58734) (diff)
downloadansible-fed90efc4d95417160efb651e3393391bb2b247a.tar.xz
ansible-fed90efc4d95417160efb651e3393391bb2b247a.zip
Fix unicode error in changelog generation
Diffstat (limited to 'packaging/release/changelogs/changelog.py')
-rwxr-xr-xpackaging/release/changelogs/changelog.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/packaging/release/changelogs/changelog.py b/packaging/release/changelogs/changelog.py
index 974324d58e..576fc98e81 100755
--- a/packaging/release/changelogs/changelog.py
+++ b/packaging/release/changelogs/changelog.py
@@ -26,6 +26,7 @@ except ImportError:
from ansible import constants as C
from ansible.module_utils.six import string_types
+from ansible.module_utils._text import to_bytes
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
CHANGELOG_DIR = os.path.join(BASE_DIR, 'changelogs')
@@ -285,8 +286,8 @@ def generate_changelog(changes, plugins, fragments):
generator = ChangelogGenerator(config, changes, plugins, fragments)
rst = generator.generate()
- with open(changelog_path, 'w') as changelog_fd:
- changelog_fd.write(rst)
+ with open(changelog_path, 'wb') as changelog_fd:
+ changelog_fd.write(to_bytes(rst))
class ChangelogFragmentLinter(object):