Fix YouTube stub under Python 3 BOM-930 (#22056)

This commit is contained in:
Jeremy Bowman
2019-10-17 10:43:04 -04:00
committed by GitHub
parent b351e58c25
commit e258fab1ea

View File

@@ -105,7 +105,7 @@ class StubYouTubeHandler(StubHttpRequestHandler):
# We need to do this every time because Google sometimes sends different responses
# as part of their own experiments, which has caused our tests to become "flaky"
self.log_message("Getting iframe api from youtube.com")
iframe_api_response = requests.get('https://www.youtube.com/iframe_api').content.strip("\n")
iframe_api_response = requests.get('https://www.youtube.com/iframe_api').content.strip(b"\n")
self.send_response(200, content=iframe_api_response, headers={'Content-type': 'text/html'})
else: