Fixes for celery worker Python 3 bugs (#22479)

This commit is contained in:
Jeremy Bowman
2019-12-10 14:07:27 -05:00
committed by GitHub
parent 01b6b19f2e
commit 0e1881f525
6 changed files with 10 additions and 8 deletions

View File

@@ -661,9 +661,11 @@ class Transcript(object):
try:
# With error handling (set to 'ERROR_RAISE'), we will be getting
# the exception if something went wrong in parsing the transcript.
if isinstance(content, text_type):
content = content.encode('utf-8')
srt_subs = SubRipFile.from_string(
# Skip byte order mark(BOM) character
content.encode('utf-8').decode('utf-8-sig'),
content.decode('utf-8-sig'),
error_handling=SubRipFile.ERROR_RAISE
)
except Error as ex: # Base exception from pysrt

View File

@@ -294,9 +294,9 @@ def yt_video_metadata(request):
status_code = res.status_code
if res.status_code == 200:
try:
res = res.json()
if res.get('items', []):
response = res
res_json = res.json()
if res_json.get('items', []):
response = res_json
else:
logging.warning(u'Unable to find the items in response. Following response '
u'was received: {res}'.format(res=res.text))

View File

@@ -251,7 +251,7 @@ webencodings==0.5.1 # via html5lib
webob==1.8.5 # via xblock
wrapt==1.10.5
git+https://github.com/edx-solutions/xblock-drag-and-drop-v2@v2.2.6#egg=xblock-drag-and-drop-v2==2.2.6
git+https://github.com/open-craft/xblock-poll@add89e14558c30f3c8dc7431e5cd6536fff6d941#egg=xblock-poll==1.5.1
git+https://github.com/open-craft/xblock-poll@6894592402fd180db864bfce539f17bac6443866#egg=xblock-poll==1.9.0
xblock-utils==1.2.2
xblock==1.2.9
xmlsec==1.3.3 # via python3-saml

View File

@@ -344,7 +344,7 @@ websocket-client==0.56.0
werkzeug==0.16.0
wrapt==1.10.5
git+https://github.com/edx-solutions/xblock-drag-and-drop-v2@v2.2.6#egg=xblock-drag-and-drop-v2==2.2.6
git+https://github.com/open-craft/xblock-poll@add89e14558c30f3c8dc7431e5cd6536fff6d941#egg=xblock-poll==1.5.1
git+https://github.com/open-craft/xblock-poll@6894592402fd180db864bfce539f17bac6443866#egg=xblock-poll==1.9.0
xblock-utils==1.2.2
xblock==1.2.9
xmlsec==1.3.3

View File

@@ -92,5 +92,5 @@ git+https://github.com/edx/xblock-lti-consumer.git@v1.2.1#egg=lti_consumer-xbloc
# Third Party XBlocks
git+https://github.com/joestump/python-oauth2.git@b94f69b1ad195513547924e380d9265133e995fa#egg=oauth2
git+https://github.com/open-craft/xblock-poll@add89e14558c30f3c8dc7431e5cd6536fff6d941#egg=xblock-poll==1.5.1
git+https://github.com/open-craft/xblock-poll@6894592402fd180db864bfce539f17bac6443866#egg=xblock-poll==1.9.0
git+https://github.com/edx-solutions/xblock-drag-and-drop-v2@v2.2.6#egg=xblock-drag-and-drop-v2==2.2.6

View File

@@ -326,7 +326,7 @@ websocket-client==0.56.0 # via docker
werkzeug==0.16.0 # via moto
wrapt==1.10.5
git+https://github.com/edx-solutions/xblock-drag-and-drop-v2@v2.2.6#egg=xblock-drag-and-drop-v2==2.2.6
git+https://github.com/open-craft/xblock-poll@add89e14558c30f3c8dc7431e5cd6536fff6d941#egg=xblock-poll==1.5.1
git+https://github.com/open-craft/xblock-poll@6894592402fd180db864bfce539f17bac6443866#egg=xblock-poll==1.9.0
xblock-utils==1.2.2
xblock==1.2.9
xmlsec==1.3.3