Skip to content
Snippets Groups Projects
Commit b9c60e42 authored by Sébastien Luttringer's avatar Sébastien Luttringer
Browse files

ensure changelog data are utf8

parent 0d71f245
No related branches found
No related tags found
No related merge requests found
......@@ -1160,13 +1160,19 @@ class Changelog(dict):
Object representing a changelog in memory
'''
def __init__(self, data):
self.verbatim = ""
self.verbatim = u""
self.load(data)
def load(self, data):
'''
Load a changelog file
'''
# ensure data are correct UTF-8
if isinstance(data, str):
try:
data = unicode(data, "UTF-8")
except UnicodeDecodeError:
raise Exception("Invalid character encoding in changelog")
version = None
lines = data.split("\n")
for line in lines:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment