From 44f60ba141204073983e99b56cfb8ce061bc01cc Mon Sep 17 00:00:00 2001 From: mehdy Date: Sun, 29 Nov 2015 18:27:05 +0330 Subject: [PATCH] fixed #1198 issue by encoding the unicode parameters to bytes and decoding the bytes response to unicode --- _pytest/pastebin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pytest/pastebin.py b/_pytest/pastebin.py index f5e479158..0b662c62b 100644 --- a/_pytest/pastebin.py +++ b/_pytest/pastebin.py @@ -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))