Skip to content

Commit db9bd21

Browse files
committed
Add code to fix the decoding problem
i.e. 'utf8' codec can't decode
1 parent 2e517d0 commit db9bd21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

about_code_tool/about.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ def generate_attribution(self, template_path=None, limit_to=None):
11421142
if not dje_license_name in license_dict \
11431143
and not dje_license_name == None:
11441144
if about_object.license_text():
1145-
license_dict[about_object.get_dje_license_name()] = about_object.license_text()
1145+
license_dict[about_object.get_dje_license_name()] = unicode(about_object.license_text(), errors='replace')
11461146
else:
11471147
msg = 'About resource: %s - license_text does not exist.'\
11481148
' License generation is skipped.'\
@@ -1153,7 +1153,7 @@ def generate_attribution(self, template_path=None, limit_to=None):
11531153
elif about_object.get_license_text_file_name():
11541154
if not about_object.get_license_text_file_name() in license_dict:
11551155
if about_object.license_text():
1156-
license_dict[about_object.get_license_text_file_name()] = about_object.license_text()
1156+
license_dict[about_object.get_license_text_file_name()] = unicode(about_object.license_text(), errors='replace')
11571157
else:
11581158
msg = 'About resource: %s - license_text does not exist.'\
11591159
' License generation is skipped.'\

0 commit comments

Comments
 (0)