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

get_last_modified and localization #260

Open
NicolasGoeddel opened this issue Feb 20, 2021 · 0 comments
Open

get_last_modified and localization #260

NicolasGoeddel opened this issue Feb 20, 2021 · 0 comments

Comments

@NicolasGoeddel
Copy link

NicolasGoeddel commented Feb 20, 2021

Owncloud gives my me a date in the form Sat, 20 Feb 2021 06:05:22 GMT but my python code uses the german locale settings de_DE.UTF-8. Because of that I run into a ValueError:

  Module sw.utilities.utilities.owncloud, line 288, in get_last_modified
  Module _strptime, line 565, in _strptime_datetime
  Module _strptime, line 362, in _strptime
ValueError: time data 'Sat, 20 Feb 2021 06:05:22 GMT' does not match format '%a, %d %b %Y %H:%M:%S %Z'

In this case it expects the string Sa (Samstag) instead if Sat (Saturday). This case should be fixed so that the date parsing is independent from the locale settings of the rest of the code. The same happens if the english month is different from the one in any other language.
It would be best if this also works in a multithreaded environment where changing the locale settings temporarily is not a good idea I guess.

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

1 participant