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

Python 3.9 compatibility #5

Closed
pogman-code opened this issue Dec 7, 2020 · 4 comments
Closed

Python 3.9 compatibility #5

pogman-code opened this issue Dec 7, 2020 · 4 comments

Comments

@pogman-code
Copy link

Hi,
After the 3.9 update I have the following error:

"/home/<USER>/.local/lib/python3.9/site-packages/irc_bot/utils.py", line 48, in decode_html
Dec 07 19:32:19 <USER> flexget[118472]:     return h.unescape(data)
Dec 07 19:32:19 <USER> flexget[118472]:            |          -> 'PING :XXXXXXX'
Dec 07 19:32:19 <USER> flexget[118472]:            -> <html.parser.HTMLParser object at 0x7f6f66741280>
Dec 07 19:32:19 <USER> flexget[118472]: AttributeError: 'HTMLParser' object has no attribute 'unescape'

And according to https://docs.python.org/3/whatsnew/3.9.html

The unescape() method in the html.parser.HTMLParser class has been removed (it was deprecated since Python 3.4). 
html.unescape() should be used for converting character references to the corresponding unicode characters.

Let me know if I can be of any help resolving this :)

@cvium
Copy link
Owner

cvium commented Dec 9, 2020

It doesn't look like python-future has implemented html.unescape, so to fix it I guess you would have to do some try except stuff or check for python version.

It's not something I am going to fix, but I do accept pull requests.

@pogman-code
Copy link
Author

Yes, I realized my mistake later as I didn't thought of Python 2 backward compatibility.

As far as I understand it irc_bot use six to ensure it so I guess it's up to six to fix this issue :)
It as been brought there: benjaminp/six#340

Sadly I am not very familiar with six so I don't think I'll be able to provide a fix for them to merge, hopefully someone will :D

@cvium cvium reopened this Dec 9, 2020
@cvium
Copy link
Owner

cvium commented Dec 9, 2020

I use both future and six. Neither have support for html.unescape yet.

@cvium
Copy link
Owner

cvium commented Jun 28, 2021

Should be fixed by the newest release

@cvium cvium closed this as completed Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants