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

Problems with Python3.7 and #6

Closed
HWHardsoft opened this issue Mar 29, 2020 · 3 comments
Closed

Problems with Python3.7 and #6

HWHardsoft opened this issue Mar 29, 2020 · 3 comments
Labels
help wanted can't get it up and running? just ask for help.

Comments

@HWHardsoft
Copy link
Collaborator

Hi,
I want to use your weather station code but when I try to start the code under Python 3.7 I will get an error - see attached picture.

grafik

Localisation is set to UTF-8 and 'de' for Germany.
What can I do?

Thx for your help

@HWHardsoft
Copy link
Collaborator Author

solved!!!
locale.setlocale(locale.LC_ALL, '')
works fine!

@LoveBootCaptain
Copy link
Owner

LoveBootCaptain commented Apr 30, 2020

i will check that again when i get my new RPI zero W ;)
will fix it in the open feature branch if still fix needed.
I'm currently have to disable that line on my dev maschine since this command does not work on mac os.
this line is needed to localize the date strings for weekdays. i think your fix will always fallback to the default configured locale? right?
if i might remember correct this made issues when someone has more than one locale configured in their os. a guy from china pointed me once on that... but I'm unsure cause it's long ago.

@LoveBootCaptain
Copy link
Owner

Hi again,

i checked again... it is working in 3.7.x with locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())

you have to setup a valid UTF-8 default locale on the Pi with sudo raspi-config

on a local maschine i have to use locale.setlocale(locale.LC_ALL, ('de_DE', 'UTF-8'))

locale is always a tuple, so it is not enough to set it to 'de' only.

check the current /development branch... there i introduced a switch for local development and production mode by setting an extra env-variable in config.json

will close this one cause i can't reproduce

@LoveBootCaptain LoveBootCaptain added the help wanted can't get it up and running? just ask for help. label May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted can't get it up and running? just ask for help.
Projects
None yet
Development

No branches or pull requests

2 participants