|
@@ -9,6 +9,7 @@ import urllib.request as url
|
|
|
import json
|
|
import json
|
|
|
import os
|
|
import os
|
|
|
import argparse
|
|
import argparse
|
|
|
|
|
+import io
|
|
|
|
|
|
|
|
def fetch():
|
|
def fetch():
|
|
|
""" Fetch issues that match given jql query """
|
|
""" Fetch issues that match given jql query """
|
|
@@ -42,8 +43,8 @@ def fetch():
|
|
|
print('Progress: | = ' + str(max_results) + ' issues')
|
|
print('Progress: | = ' + str(max_results) + ' issues')
|
|
|
while start_at < total:
|
|
while start_at < total:
|
|
|
with url.urlopen(request.format(jql, start_at, max_results)) as conn:
|
|
with url.urlopen(request.format(jql, start_at, max_results)) as conn:
|
|
|
- with open('issues/res' + str(start_at) + '.json', 'w') as f:
|
|
|
|
|
- f.write(conn.read().decode('utf-8'))
|
|
|
|
|
|
|
+ with io.open('issues/res' + str(start_at) + '.json', 'w', encoding="utf-8") as f:
|
|
|
|
|
+ f.write(conn.read().decode('utf-8', 'ignore'))
|
|
|
print('|', end='', flush='True')
|
|
print('|', end='', flush='True')
|
|
|
start_at += max_results
|
|
start_at += max_results
|
|
|
|
|
|