Skip to content

Commit 68e5e6d

Browse files
committed
handle spaces for the DJE url.
1 parent 99868ae commit 68e5e6d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

about_code_tool/genabout.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ def request_license_data(self, url, username, api_key, license_key):
232232
full_url = '{0}{1}/?{2}'.format(
233233
url if url.endswith('/') else url + '/',
234234
license_key, urllib.urlencode(payload))
235+
# The following is to handle special characters in URL such as space etc.
236+
full_url = urllib.quote(full_url, safe="%/:=&?~#+!$,;'@()*[]")
235237

236238
try:
237239
request = urllib2.Request(full_url)
@@ -336,8 +338,7 @@ def pre_process_and_dje_license_list(self, input_list, api_url, api_username, ap
336338
try:
337339
if line['dje_license']:
338340
detail = self.get_license_details_from_api(api_url, api_username, api_key, line['dje_license'])
339-
line['dje_license_name'] = detail[0]
340-
key_text_dict[line['dje_license']] = detail[1]
341+
line['dje_license_name'], key_text_dict[line['dje_license']] = detail
341342
except Exception as e:
342343
self.warnings.append(Warn('dje_license', '',
343344
"Missing 'dje_license' for " + line['about_file']))

0 commit comments

Comments
 (0)