Need help with UnicodeError using xbmcvfs.rename - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Need help with UnicodeError using xbmcvfs.rename (/showthread.php?tid=360381) |
Need help with UnicodeError using xbmcvfs.rename - jona303 - 2021-02-07 I'm not a python developper and I imagine it's a newbie question, but I can't fin any answer to my problem, or I can't understand it and I need someone to explain me like I'm six. So I would like to rename some files but files with name that contains some characters like single quotes triggers UnicodeDecodeError. I tried with kodi.six but I still have the issue. I also tried to encode them but with no success.
Can someone help me with this ? RE: Need help with UnicodeError using xbmcvfs.rename - Roman_V_M - 2021-02-08 The difference between byte and text strings and the respective design flaws of Python 2 require a lecture of its own. But since Kodi 19 Matrix release is not far away I'd recommend to forget about Python 2 and all its str/unicode mess. Use Python 3 for your addon. RE: Need help with UnicodeError using xbmcvfs.rename - jona303 - 2021-02-08 (2021-02-08, 00:11)Roman_V_M Wrote: The difference between byte and text strings and the respective design flaws of Python 2 require a lecture of its own. But since Kodi 19 Matrix release is not far away I'd recommend to forget about Python 2 and all its str/unicode mess. Use Python 3 for your addon. Thank you for your answer. I thank kodi.six would have fix the str/unicode mess. RE: Need help with UnicodeError using xbmcvfs.rename - Roman_V_M - 2021-02-08 (2021-02-08, 10:23)jona303 Wrote: I thank kodi.six would have fix the str/unicode mess.kodi_six normalizes strings passed to/from Kodi API functions/methods. It does not address the flaws of Python 2 itself. That would require re-writing the whole language runtime and it has already been done (Python 3.x). |