|
@@ -1,5 +1,7 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
2
|
2
|
|
|
3
|
+from __future__ import print_function
|
|
4
|
+
|
3
|
5
|
import sys
|
4
|
6
|
import re
|
5
|
7
|
import itertools
|
|
@@ -24,6 +26,7 @@ if PY3:
|
24
|
26
|
def urlparse_foo(link):
|
25
|
27
|
return urllib.parse.parse_qs(urllib.parse.urlparse(link).query)['v'][0]
|
26
|
28
|
else:
|
|
29
|
+ import urllib
|
27
|
30
|
import urlparse
|
28
|
31
|
def urlparse_foo(link):
|
29
|
32
|
return urlparse.parse_qs(urlparse.urlparse(link).query)['v'][0]
|
|
@@ -398,7 +401,7 @@ def restRequest(url):
|
398
|
401
|
sys.stderr.write("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n")
|
399
|
402
|
sys.stderr.write("\n")
|
400
|
403
|
return ""
|
401
|
|
- data = json.loads(response.read())
|
|
404
|
+ data = json.loads(response.read().decode("utf-8"))
|
402
|
405
|
return data
|
403
|
406
|
|
404
|
407
|
def restReleases(user, repo):
|
|
@@ -449,8 +452,8 @@ def include_url(url):
|
449
|
452
|
response = urllib.request.urlopen(url) if PY3 else urllib.urlopen(url)
|
450
|
453
|
if response.getcode() != 200:
|
451
|
454
|
raise Exception("invalid response code", response.getcode())
|
452
|
|
- data = response.read()
|
453
|
|
- print(data,)
|
|
455
|
+ data = response.read().decode("utf-8")
|
|
456
|
+ print(data, end="")
|
454
|
457
|
|
455
|
458
|
# -----------------------------------------------------------------------------
|
456
|
459
|
# preconvert hooks
|