Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for deprecated HTMLParser.unescape for python >=3.9 #651

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions edx_dl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@

# This module contains generic functions, ideally useful to any other module
from six.moves.urllib.request import urlopen, Request
from six.moves import html_parser

import sys
if sys.version_info[0] >= 3:
import html
else:
from six.moves import html_parser
html = html_parser.HTMLParser()

import errno
import json
Expand Down Expand Up @@ -119,7 +125,7 @@ def clean_filename(s, minimal_change=False):
"""

# First, deal with URL encoded strings
h = html_parser.HTMLParser()
h = html
s = h.unescape(s)

# strip paren portions which contain trailing time length (...)
Expand Down