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

Update plugin.py #2

Merged
merged 1 commit into from Apr 10, 2020
Merged

Update plugin.py #2

merged 1 commit into from Apr 10, 2020

Conversation

athoik
Copy link
Contributor

@athoik athoik commented Mar 22, 2020

Newer twisted seems to have issues with Unicode characters (eg Sliač).

Using function quote from urllib2 seems to fix the issue.

Here is the traceback produced without quote function.

Traceback (most recent call last):
File "/usr/lib/enigma2/python/mytest.py", line 209, in processDelay
self.popCurrent()
File "/usr/lib/enigma2/python/mytest.py", line 278, in popCurrent
self.execBegin(first=False, do_show=do_show)
File "/usr/lib/enigma2/python/mytest.py", line 228, in execBegin
c.show()
File "/usr/lib/enigma2/python/Screens/Screen.py", line 150, in show
File "/usr/lib/enigma2/python/plugin.py", line 322, in get_weather_data
File "/usr/lib/enigma2/python/plugin.py", line 318, in get_xmlfile
File "/usr/lib/python2.7/site-packages/twisted/python/deprecate.py", line 301, in deprecatedFunction
File "/usr/lib/python2.7/site-packages/twisted/web/client.py", line 814, in downloadPage
File "/usr/lib/python2.7/site-packages/twisted/web/client.py", line 742, in _makeGetterFactory
File "/usr/lib/python2.7/site-packages/twisted/web/_newclient.py", line 648, in _ensureValidURI
ValueError: Invalid URI 'http://weather.service.msn.com/data.aspx?weadegreetype=C&culture=sk-SK&weasearchstr=Slia\xc4\x8d&src=outlook'

Newer twisted seems to have issues with Unicode characters (eg Sliač).

Using function quote from urllib2 seems to fix the issue.

Here is the traceback produced without quote function.

Traceback (most recent call last):
  File "/usr/lib/enigma2/python/mytest.py", line 209, in processDelay
    self.popCurrent()
  File "/usr/lib/enigma2/python/mytest.py", line 278, in popCurrent
    self.execBegin(first=False, do_show=do_show)
  File "/usr/lib/enigma2/python/mytest.py", line 228, in execBegin
    c.show()
  File "/usr/lib/enigma2/python/Screens/Screen.py", line 150, in show
  File "/usr/lib/enigma2/python/plugin.py", line 322, in get_weather_data
  File "/usr/lib/enigma2/python/plugin.py", line 318, in get_xmlfile
  File "/usr/lib/python2.7/site-packages/twisted/python/deprecate.py", line 301, in deprecatedFunction
  File "/usr/lib/python2.7/site-packages/twisted/web/client.py", line 814, in downloadPage
  File "/usr/lib/python2.7/site-packages/twisted/web/client.py", line 742, in _makeGetterFactory
  File "/usr/lib/python2.7/site-packages/twisted/web/_newclient.py", line 648, in _ensureValidURI
ValueError: Invalid URI 'http://weather.service.msn.com/data.aspx?weadegreetype=C&culture=sk-SK&weasearchstr=Slia\xc4\x8d&src=outlook'
@athoik
Copy link
Contributor Author

athoik commented Apr 4, 2020

@Sirius0103 any chance to merge commit?

@Sirius0103 Sirius0103 merged commit c0553c0 into Sirius0103:master Apr 10, 2020
@athoik
Copy link
Contributor Author

athoik commented Apr 10, 2020

Thanks!

@Sirius0103
Copy link
Owner

I'm sorry, I did not see the patch

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 this pull request may close these issues.

None yet

4 participants