Browse Source

Updated fetch.py to safe quote rather than replacing the string manually

Oscar Svensson
ossv 6 years ago
parent
commit
1cea94c548
1 changed files with 3 additions and 1 deletions
  1. 3 1
      code/fetch_jira_bugs/fetch.py

+ 3 - 1
code/fetch_jira_bugs/fetch.py

@@ -3,6 +3,8 @@ __author__ = "Kristian Berg"
 __copyright__ = "Copyright (c) 2018 Axis Communications AB"
 __copyright__ = "Copyright (c) 2018 Axis Communications AB"
 __license__ = "MIT"
 __license__ = "MIT"
 
 
+from urllib.parse import quote
+
 import urllib.request as url
 import urllib.request as url
 import json
 import json
 import os
 import os
@@ -18,7 +20,7 @@ def fetch():
         + 'AND component = core '\
         + 'AND component = core '\
         + 'AND created <= "2018-02-20 10:34" '\
         + 'AND created <= "2018-02-20 10:34" '\
         + 'ORDER BY created DESC'
         + 'ORDER BY created DESC'
-    jql = jql.replace(' ', '%20')
+    jql = quote(jql, safe='')
 
 
     start_at = 0
     start_at = 0