Skip to content

Commit 1b1455b

Browse files
author
Pete Martin
committed
Fix to to following issue:
googleapis#28 "UnicodeDecodeError in discovery.createNextMethod()"
1 parent b246d51 commit 1b1455b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

googleapiclient/discovery.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,11 @@ def methodNext(self, previous_request, previous_response):
859859
request = copy.copy(previous_request)
860860

861861
pageToken = previous_response['nextPageToken']
862-
parsed = list(urlparse(request.uri))
862+
try:
863+
uri = request.uri.encode('utf-8')
864+
except UnicodeDecodeError:
865+
uri = request.uri
866+
parsed = list(urlparse(uri))
863867
q = parse_qsl(parsed[4])
864868

865869
# Find and remove old 'pageToken' value from URI

0 commit comments

Comments
 (0)