rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.51k stars 401 forks source link

windows 10 + python 3.9: AttributeError: 'HTMLParser' object has no attribute 'unescape' #412

Closed wdehoog closed 3 years ago

wdehoog commented 3 years ago

When trying to launch a script on windows 10 using python 3.9 I get: AttributeError: 'HTMLParser' object has no attribute 'unescape' See below. Adding the exception on line 41 of gui.py makes it work for me: except (ImportError, AttributeError):

Stacktrace:

Traceback (most recent call last):
  File "C:\Python39\lib\site-packages\remi\gui.py", line 32, in <module>
    from HTMLParser import HTMLParser
ModuleNotFoundError: No module named 'HTMLParser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Exalon\x62-git\HART-trunk\PyX62Flasher\psgx62flasher.py", line 10, in <module>
    import PySimpleGUIWeb as sg
  File "C:\Python39\lib\site-packages\PySimpleGUIWeb\__init__.py", line 2, in <module>
    from .PySimpleGUIWeb import *
  File "C:\Python39\lib\site-packages\PySimpleGUIWeb\PySimpleGUIWeb.py", line 14, in <module>
    import remi
  File "C:\Python39\lib\site-packages\remi\__init__.py", line 1, in <module>
    from .gui import Widget, Button, TextInput, \
  File "C:\Python39\lib\site-packages\remi\gui.py", line 40, in <module>
    unescape = h.unescape
AttributeError: 'HTMLParser' object has no attribute 'unescape'
dddomodossola commented 3 years ago

@wdehoog Thank you very much for reporting. Should be fixed now ;-)

m-kareem commented 3 years ago

Hi @dddomodossola ,

I am using remi (2021.3.2) with Python (3.8.8) on macOS 11.3.1, and I am getting this message every time I run my GUI:

.../site-packages/remi/gui.py:2780: DeprecationWarning: The unescape method is deprecated and will be removed in 3.5, use html.unescape() instead. def value(self): return unescape(self.attributes.get('value', '').replace('&nbsp;', ' '))

I though this might be related to the issue reported in this ticket. Is there anything I should be worry about or to fix?

Best,