Skip to content

Commit 8fac605

Browse files
committed
Handle error exception and encoding problem
1 parent bfe74ef commit 8fac605

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

about_code_tool/MAPPING.CONFIG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
# Essential Fields
3232
about_resource: file_name
33-
about_file: Resource
33+
about_file: Directory/Filename
3434

3535

3636
# Mandatory Fields

about_code_tool/genabout.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,12 @@ def extract_dje_license(self, project_path, license_list, url, username, key):
250250
self.errors.append(Error('dje_license_key', license_key,
251251
"Invalid 'dje_license_key'"))
252252
else:
253-
with open(gen_license_path, 'wb') as output:
254-
output.write(context)
253+
try:
254+
with open(gen_license_path, 'wb') as output:
255+
output.write(context.encode('utf8'))
256+
except Exception as e:
257+
self.errors.append(Error('Unknown', gen_license_path,
258+
"Something is wrong."))
255259

256260
@staticmethod
257261
def get_license_text_from_api(url, username, api_key, license_key):

0 commit comments

Comments
 (0)