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

Dropbox Lib Not Python 2.6 Compatible #126

Closed
robweber opened this issue Dec 11, 2017 · 10 comments
Closed

Dropbox Lib Not Python 2.6 Compatible #126

robweber opened this issue Dec 11, 2017 · 10 comments
Labels

Comments

@robweber
Copy link
Owner

Errors are being thrown on Kodi 16 installs running Android or RPi OSes related to 2.6 compatibility. Original staketrace from Kodi Forum below although there may be others once this is fixed:

12:14:35 T:18446744071899183392   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: invalid syntax (stone_validators.py, line 427)
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/scheduler.py", line 9, in <module>
                                                from resources.lib.backup import XbmcBackup
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/resources/lib/backup.py", line 7, in <module>
                                                from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem,GoogleDriveFilesystem
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/resources/lib/vfs.py", line 10, in <module>
                                                import dropbox
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/resources/lib/dropbox/__init__.py", line 3, in <module>
                                                from .dropbox import __version__, Dropbox, DropboxTeam, create_session  # noqa: F401
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/resources/lib/dropbox/dropbox.py", line 20, in <module>
                                                from . import files, stone_serializers
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/resources/lib/dropbox/files.py", line 10, in <module>
                                                from . import stone_validators as bv
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-master/resources/lib/dropbox/stone_validators.py", line 427
                                                self.value_validator.validate(value) for key, value in val.items()
                                                                                       ^
                                            SyntaxError: invalid syntax
                                            -->End of Python script error 
@robweber robweber added the bug label Dec 11, 2017
@robweber
Copy link
Owner Author

Branch for working on these fixes is here: https://github.com/robweber/xbmcbackup/tree/dropbox_2.6_fixes

robweber added a commit that referenced this issue Dec 12, 2017
@tofof
Copy link

tofof commented Dec 14, 2017

Tried this branch (with that first commit) on an affected android system, now getting this error:

19:59:16 T:18446744072513358208   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: ('invalid syntax', ('/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/stone_serializers.py', 242, 69, '                self.encode_sub(validator.value_validator, value) for\n'))
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/scheduler.py", line 9, in <module>
                                                from resources.lib.backup import XbmcBackup
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/backup.py", line 7, in <module>
                                                from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem,GoogleDriveFilesystem
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/vfs.py", line 10, in <module>
                                                import dropbox
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/__init__.py", line 3, in <module>
                                                from .dropbox import __version__, Dropbox, DropboxTeam, create_session  # noqa: F401
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/dropbox.py", line 20, in <module>
                                                from . import files, stone_serializers
                                            SyntaxError: ('invalid syntax', ('/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/stone_serializers.py', 242, 69, '                self.encode_sub(validator.value_validator, value) for\n'))
                                            -->End of Python script error report<--

@robweber
Copy link
Owner Author

Great - thank you. Figures there is another issue somewhere. Looks like the same type of coding issue with trying to assign a dict from within a for loop.

https://github.com/robweber/xbmcbackup/blob/dropbox_2.6_fixes/resources/lib/dropbox/stone_serializers.py#L240

robweber added a commit that referenced this issue Dec 15, 2017
@robweber
Copy link
Owner Author

@tofof - fixed the error you had. Hopefully that's the last one.

@tofof
Copy link

tofof commented Dec 17, 2017

No joy, sorry.

This error, like the other two, is on startup.

16:01:00 T:18446744072321714928   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: ('invalid syntax', ('/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/stone_serializers.py', 857, 11, '        for key, value in obj.items()\n'))
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/scheduler.py", line 9, in <module>
                                                from resources.lib.backup import XbmcBackup
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/backup.py", line 7, in <module>
                                                from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem,GoogleDriveFilesystem
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/vfs.py", line 10, in <module>
                                                import dropbox
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/__init__.py", line 3, in <module>
                                                from .dropbox import __version__, Dropbox, DropboxTeam, create_session  # noqa: F401
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/dropbox.py", line 20, in <module>
                                                from . import files, stone_serializers
                                            SyntaxError: ('invalid syntax', ('/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/stone_serializers.py', 857, 11, '        for key, value in obj.items()\n'))
                                            -->End of Python script error report<--

robweber added a commit that referenced this issue Dec 19, 2017
@robweber
Copy link
Owner Author

Ok, fixed 2 more I think. Sorry for all the back and forth. I don't have an Android device with Jarvis on it. Krypton won't throw this error as Android was updated to 2.7 on that system.

@tofof
Copy link

tofof commented Dec 19, 2017

Yeah, it seemed like you didn't have that test environment from your wording on the initial post in this issue -- that's why I tossed you that first error. No worries; thank you for dealing with this bug at all.

13:22:47 T:18446744072299792688   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: ('invalid syntax', ('/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/oauth.py', 514, 43, '    utf8_params = {encode(k): encode(v) for k, v in six.iteritems(params)}\n'))
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/scheduler.py", line 9, in <module>
                                                from resources.lib.backup import XbmcBackup
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/backup.py", line 7, in <module>
                                                from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem,GoogleDriveFilesystem
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/vfs.py", line 10, in <module>
                                                import dropbox
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/__init__.py", line 4, in <module>
                                                from .oauth import DropboxOAuth2Flow, DropboxOAuth2FlowNoRedirect  # noqa: F401
                                            SyntaxError: ('invalid syntax', ('/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/xbmcbackup-dropbox_2.6_fixes/resources/lib/dropbox/oauth.py', 514, 43, '    utf8_params = {encode(k): encode(v) for k, v in six.iteritems(params)}\n'))
                                            -->End of Python script error report<--

robweber added a commit that referenced this issue Dec 19, 2017
@robweber
Copy link
Owner Author

Different file this time, hopefully homing in on the last of these.

@tofof
Copy link

tofof commented Dec 19, 2017

Hey, that seems to be the last of them. Were they all set/dict comprehensions?

@robweber
Copy link
Owner Author

Yup.

Glad that seems to have fixed. I'll post back in the Kodi forum for others to try. Hopefully merged in and posted to the repo by the end of the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants