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

error after upgrade from v0.2.1 to v0.2.3 in kodi #27

Open
Manyone1 opened this issue Oct 11, 2019 · 10 comments · May be fixed by #30
Open

error after upgrade from v0.2.1 to v0.2.3 in kodi #27

Manyone1 opened this issue Oct 11, 2019 · 10 comments · May be fixed by #30

Comments

@Manyone1
Copy link

the problem occurs when i use the addon missingmovies to find new movies on disk.
it is only on folders with german characters like äÄöÖüÜß
with v.0.2.1 ther are no problems but with v0.2.3 there comes up an error.
I tried the 0.2.2 to, by manual installation, so i dont know if it is a reference, but the same error as in 0.2.3 comes up.
error_missingmovies.txt

@dagwieers
Copy link
Contributor

@mediaminister This one is up your alley 😉

@mediaminister
Copy link

Most likely the arguments in argv are not decoded to unicode in the run function. Converting the incoming arguments to unicode should fix this problem:

for i, arg in enumerate(argv):
    argv[i] = to_unicode(arg)

@dagwieers
Copy link
Contributor

dagwieers commented Jan 9, 2020

@mediaminister I guess that the calling add-on is not using unicode_literals while this add-on now does.

@Manyone1 I guess we need to discuss this with the missingmovies add-on author to discuss the best way forward. I expect this add-on not to be ready for Python 3 either.

@mediaminister
Copy link

mediaminister commented Jan 9, 2020

I guess that the calling add-on is not using unicode_literals while this add-on now does.

The problem with the routing add-on is that sys.argv doesn't support unicode strings in Python2, so this is always treated as ASCII. You have to decode the arguments that are passed through sys in Python2 to unicode.

@dagwieers
Copy link
Contributor

dagwieers commented Jan 9, 2020

But if you import unicode_literals from future, any string in Python2 is considered unicode.

I would be surprised if sys.argv would be excluded from being a unicode literal. But it appears you are right (again!). It appears a list of standard libraries do not use unicode literals by default 😞

[dag@moria ~]$ python2 -c 'import sys; print type(sys.argv[1])' föobàr
<type 'str'>
[dag@moria ~]$ python2 -c 'from __future__ import unicode_literals; import sys; print type(sys.argv[1])' föobàr
<type 'str'>

I will make a PR for this.

@dagwieers dagwieers linked a pull request Jan 9, 2020 that will close this issue
@dagwieers
Copy link
Contributor

@Manyone1 Can you try the following fix by installing this ZIP file: https://github.com/dagwieers/kodi-plugin-routing/archive/argv-unicode.zip

It should provide you with a working v0.2.3 release and should be a good workaround until an update is released. Please report back!

@Manyone1
Copy link
Author

doesnt work, back on 0.2.1

@dagwieers
Copy link
Contributor

@Manyone1 Can you share a log when using this version? It may fail for another reason...

@dagwieers
Copy link
Contributor

I can confirm with my tests that we did fix the unicode_literals problem with sys.argv that could lead to the errors you see.

@Manyone1
Copy link
Author

log.txt
have it a little bit shorten

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

Successfully merging a pull request may close this issue.

3 participants