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

Problem with German region format #7

Open
mase76 opened this issue Jul 15, 2017 · 11 comments
Open

Problem with German region format #7

mase76 opened this issue Jul 15, 2017 · 11 comments

Comments

@mase76
Copy link

mase76 commented Jul 15, 2017

Hi!
I am getting this error when trying to browse with the Massengeschmack addon on my Debian
Stretch machine with Kodi 18 Master:

01:59:01.348 T:139685992642304 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.ValueError'> Error Contents: time data 'Thu, 13 Jul 2017 20:00:00' does not match format '%a, %d %b %Y %H:%M:%S' Traceback (most recent call last): File "/home/mase/.kodi/addons/plugin.video.massengeschmack/default.py", line 45, in <module> if listing.generate(datasource): File "/home/mase/.kodi/addons/plugin.video.massengeschmack/resources/lib/listing.py", line 46, in generate for i in items: File "/home/mase/.kodi/addons/plugin.video.massengeschmack/resources/lib/datasource.py", line 302, in getListItems 'premiered' : resources.lib.parseUTCDateString(i['pubdate']).strftime('%Y-%m-%d'), File "/home/mase/.kodi/addons/plugin.video.massengeschmack/resources/lib/__init__.py", line 324, in parseUTCDateString date = datetime.strptime(datestr[:-6], format) File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime (data_string, format)) ValueError: time data 'Thu, 13 Jul 2017 20:00:00' does not match format '%a, %d %b %Y %H:%M:%S' -->End of Python script error report<-- 01:59:01.443 T:139688306874752 ERROR: GetDirectory - Error getting plugin://plugin.video.massengeschmack/?cmd=list&module=main 01:59:01.445 T:139688306874752 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.massengeschmack/?cmd=list&module=main) failed 02:00:59.435 T:139685875668736 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.ValueError'> Error Contents: time data 'Tue, 08 Nov 2016 20:00:00' does not match format '%a, %d %b %Y %H:%M:%S' Traceback (most recent call last): File "/home/mase/.kodi/addons/plugin.video.massengeschmack/default.py", line 45, in <module> if listing.generate(datasource): File "/home/mase/.kodi/addons/plugin.video.massengeschmack/resources/lib/listing.py", line 46, in generate for i in items: File "/home/mase/.kodi/addons/plugin.video.massengeschmack/resources/lib/datasource.py", line 302, in getListItems 'premiered' : resources.lib.parseUTCDateString(i['pubdate']).strftime('%Y-%m-%d'), File "/home/mase/.kodi/addons/plugin.video.massengeschmack/resources/lib/__init__.py", line 326, in parseUTCDateString date = datetime(*(time.strptime(datestr[:-6], format)[0:6])) File "/usr/lib/python2.7/_strptime.py", line 478, in _strptime_time return _strptime(data_string, format)[0] File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime (data_string, format)) ValueError: time data 'Tue, 08 Nov 2016 20:00:00' does not match format '%a, %d %b %Y %H:%M:%S' -->End of Python script error report<-- 02:00:59.857 T:139688306874752 ERROR: GetDirectory - Error getting plugin://plugin.video.massengeschmack/?cmd=list&module=jung 02:00:59.859 T:139688306874752 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.massengeschmack/?cmd=list&module=jung) failed

I wonder, the date format seems correct.

@mase76
Copy link
Author

mase76 commented Jul 23, 2017

My locale settings seem not to recognized.

@phoerious
Copy link
Owner

Did it work with previous versions on your machine?

@mase76
Copy link
Author

mase76 commented Jul 24, 2017

The current version runs on Libreelec with Kodi 18 Master without problems.
The problem is on all my self built Debian Stretch machines.
It is a locale problem. I added the line
datestr = 'Sa, 22 Jul 2017 16:00:00 +0200'
to the function def parseUTCDateString(datestr):
to workaround this. The addon is usable again, except the release date is the
date I overwrote. A German date is expected, but In my system the addon
gets the UTC date. I don't know, if this is a Kodi or Debian specific problem.
Even when setting LC_ALL = de_DE.UTF-8, is makes no difference. It seems,
that I am alone with this problem.

@phoerious
Copy link
Owner

phoerious commented Jul 24, 2017

Must be a Kodi or Debian bug. The locale setting should be propagated properly to the plugin interpreter.

@mase76
Copy link
Author

mase76 commented Oct 29, 2017

I don't know why, but it runs again.

@mase76 mase76 closed this as completed Oct 29, 2017
@phoerious
Copy link
Owner

Great!

@mase76 mase76 reopened this Dec 26, 2017
@mase76
Copy link
Author

mase76 commented Dec 26, 2017

I reopened this issue, because I can reproduce it now.
When changing the Kodi language to German, the setting of the default region format changes
to Belgium. Then the addon works. But when I set the default region format to Germany,
I get the above date format error.

@phoerious
Copy link
Owner

I suppose I have to set the locale explicitly before parsing. I'll have to test this (but wouldn't mind if someone else made a patch).

@mase76
Copy link
Author

mase76 commented Dec 27, 2017 via email

@phoerious
Copy link
Owner

Not right now. Need to test it when I'm back home beginning of next year.

@mase76 mase76 changed the title Does not work in Kodi 18 Master Problem with German region format Feb 24, 2018
@mase76
Copy link
Author

mase76 commented Feb 24, 2018

I changed the title of this issue to a better one.

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

No branches or pull requests

2 participants