Skip to content

2 bugs remain for python 3.10 #520

Open
@retsyo

Description

  1. cgi.escape is deprecated in python 3.4 #330
    as the post says, maybe we can change remi.gui.py:
    from
import cgi
escape = cgi.escape

to

try:
    import cgi
    escape = cgi.escape
except:
    import html
    escape = html.escape
  1. windows 10 + python 3.9: AttributeError: 'HTMLParser' object has no attribute 'unescape' #412
    now we should change remi.gui.py:
    from
except ImportError:
    # Python 3
    try:
        from html.parser import HTMLParser
        h = HTMLParser()
        unescape = h.unescape
    except ImportError:
        # Python 3.4+
        import html
        unescape = html.unescape

which says

  File "e:\prg\py\winpython\python-3.10.9.amd64\lib\site-packages\remi-1.2.2-py3.10.egg\remi\gui.py", line 30, in <module>
    from HTMLParser import HTMLParser
ModuleNotFoundError: No module named 'HTMLParser'

to

except ImportError:
    # Python 3
    try:
        from html.parser import HTMLParser
        h = HTMLParser()
        unescape = h.unescape
    except:
        # Python 3.4+
        import html
        unescape = html.unescape

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions