fixed #1198 issue by encoding the unicode parameters to bytes and decoding the

bytes response to unicode
This commit is contained in:
mehdy 2015-11-29 18:27:05 +03:30
parent bced5a3f81
commit 44f60ba141
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ def create_new_paste(contents):
'expiry': '1week',
}
url = 'https://bpaste.net'
response = urlopen(url, data=urlencode(params)).read()
response = urlopen(url, data=urlencode(params).encode()).read().decode()
m = re.search(r'href="/raw/(\w+)"', response)
if m:
return '%s/show/%s' % (url, m.group(1))