CaTzil/service.subtitles.napisy24pl

Can't download subtitles on Android

Closed this issue · 3 comments

It's look like last change break plugin for android. Searching subtitles work fine, but download always crash.
Log:

21:45:15 T:1903375568  NOTICE: -->Python Interpreter Initialized<--
21:45:16 T:1903375568   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: encode() argument 1 must be string, not None
                                            Traceback (most recent call last):
                                              File "/mnt/internal_sd/Android/data/org.xbmc.kodi/files/.kodi/addons/service.subtitles.napisy24pl/service.py", line 357, in <module>
                                                subs = Download(params["id"])
                                              File "/mnt/internal_sd/Android/data/org.xbmc.kodi/files/.kodi/addons/service.subtitles.napisy24pl/service.py", line 245, in Download
                                                shutil.rmtree(__temp__.encode(sys.getfilesystemencoding()))
                                            TypeError: encode() argument 1 must be string, not None
                                            -->End of Python script error report<--
21:45:16 T:1871801856   ERROR: static bool XFILE::CDirectory::GetDirectory(const CURL&, CFileItemList&, const XFILE::CDirectory::CHints&, bool) - Error getting plugin://service.subtitles.napisy24pl/?action=download&id=86171

Enviroment:

21:44:43 T:1769868824  NOTICE: Starting Kodi (14.2 Git:2015-03-26-7cc53a9-dirty). Platform: Android ARM 32-bit
21:44:43 T:1769868824  NOTICE: Using Release Kodi x32 build
21:44:43 T:1769868824  NOTICE: Kodi compiled Mar 26 2015 by GCC 4.8.0 for Android ARM 32-bit API level 14 (API level 14)
21:44:43 T:1769868824  NOTICE: Running on rockchip rk3188 with Android 4.4.2 API level 19, kernel: Linux ARM 32-bit version 3.0.36+
21:44:43 T:1769868824  NOTICE: FFmpeg version: 14.2rc1-Helix-5-g7cc53a9-xbmc-2.4.6-Helix
21:44:43 T:1769868824  NOTICE: Host CPU: ARMv7 Processor rev 0 (v7l), 4 cores available
21:44:43 T:1769868824  NOTICE: Product: rk3188, Device: rk3188, Board: rk30sdk - Manufacturer: rockchip, Brand: rockchip, Model: rk3188, Hardware: rk30board
21:44:43 T:1769868824  NOTICE: ARM Features: Neon enabled

Related: https://code.google.com/p/python-for-android/issues/detail?id=35#c5

I don't have access to this device right now, I can check this in Tuesday.

This fix doesn't change anything - it still has the same bug with .encode(None) on Android. I've made a PR with patch that works for me: #18