MilhouseVH / texturecache.py

Utility script to manage the XBMC texture cache
http://forum.xbmc.org/showthread.php?tid=158373
GNU General Public License v2.0
181 stars 34 forks source link

DeprecationWarning in Python 3.7.1 #53

Closed akyag closed 5 years ago

akyag commented 5 years ago

Hi, I am on Python 3.7.1 and getting this warning -

/home/akya/xbmc-Texturecache/texturecache.py:241: DeprecationWarning: encodestring() is a deprecated alias since 3.1, use encodebytes()
  self.WEB_AUTH_TOKEN = base64.encodestring(bytes(token, "utf-8")).decode()

If you change the lines 241 self.WEB_AUTH_TOKEN = base64.encodestring(bytes(token, "utf-8")).decode() 243 self.WEB_AUTH_TOKEN = base64.encodestring(token)

to 241 self.WEB_AUTH_TOKEN = base64.encodebytes(bytes(token, "utf-8")).decode() 243 self.WEB_AUTH_TOKEN = base64.encodebytes(token)

It works! Sorry I don't know how to make a PR! Thanks :)

MilhouseVH commented 5 years ago

Thanks, fixed in 42c95e594b30def8f85d9f18b38906ccb211957d

I haven't changed line 243 as encodebytes() is not supported by Python2.