linuxmint / mintupdate

The Linux Mint Update Manager
324 stars 157 forks source link

.xsession_errors filling with DeprecationWarning from checkAPT.py #672

Closed lucianoloder closed 3 years ago

lucianoloder commented 3 years ago

Hi to all. I have been using LMDE3 for a while, and upgraded from LMDE2 to 3 some months ago.

I recently noticed that my .xsession_errors is getting cluttered with this warning, every some minutes:

/usr/lib/linuxmint/mintUpdate/checkAPT.py:272: DeprecationWarning: The unescape method is deprecated and will be removed in 3.5, use html.unescape() instead. value = parser.unescape(value) /usr/lib/linuxmint/mintUpdate/checkAPT.py:294: DeprecationWarning: The unescape method is deprecated and will be removed in 3.5, use html.unescape() instead. description = parser.unescape(description)

I am using python3.7, dont remember if it was by default or by some installation of mine, and maybe this is what is causing this error. The report is somewhat self-explanatory, but searching a little bit i found another project, "newspaper" which corrected something similar:

https://github.com/codelucas/newspaper/pull/269/files

So i applied the same solution to my machine, and i believe it solved the problem. The patch is simple, 3 lines modified. I used diff to create the patch, normally i use git diff, so it "may" not apply correct. checkAPT.patch.zip

I know this is silly, but since the modification is simple, here it is:

$ diff /tmp/checkAPT.py /usr/lib/linuxmint/mintUpdate/checkAPT.py 10a11,12

from https://github.com/codelucas/newspaper/pull/269/files

from html import unescape 272c274,275 < value = parser.unescape(value)

                                            #value = parser.unescape(value)
                                            value = unescape(value)

294c297,298 < description = parser.unescape(description)

                                            #description = parser.unescape(description)
                                            description = unescape(description)

Hope this can be useful.

clefebvre commented 3 years ago

It's already done on master https://github.com/linuxmint/mintupdate/commit/5f4dc2fb7efa4cff8e325869e1f39571a85981c7. LMDE 3 is EOL though.