You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jérémie / (Bobleponge91) found that pilomar.py and libraries do not understand "," as a decimal separator within Python functions if the locale specifies that character.
As a workaround the RPi's locale needs to be set to one with "." as the decimal character such as "en_GB" or "en_US".
Is there anything simple which can be implemented to make the program more tolerant of other locales?
The text was updated successfully, but these errors were encountered:
65rbeyer on Instructables reported the same problem with his build.
Traceback (most recent call last):
File "pilomar.py", line 1206, in <module>
SDCardMonitor = discmonitor(name='root',devname='/dev/root',path='/',disctype='boot',logger=MainLog.Log) # Create new disc space monitor for the SD card.
File "/home/pi/pilomar/src/pilomardisc.py", line 54, in __init__
self.Poll(force=True) # Kickstart the values.
File "/home/pi/pilomar/src/pilomardisc.py", line 98, in Poll
dfdict = self.GetDfDictionary()
File "/home/pi/pilomar/src/pilomardisc.py", line 86, in GetDfDictionary
v = int(float(v[:-1]) * ji[1]) # Convert from HR text value into absolute value.
ValueError: could not convert string to float: '4,2'
Some progress made here finally while investigating UTF-8 vs LATIN-1 character set issues.
The locale library can perform conversion of strings into the en_US numeric format.
My current development copy has been working smoothly with fr_FR language set, it now seems to recognise the different number format that the O/S commands can generate when the language is non English.
Jérémie / (Bobleponge91) found that pilomar.py and libraries do not understand "," as a decimal separator within Python functions if the locale specifies that character.
As a workaround the RPi's locale needs to be set to one with "." as the decimal character such as "en_GB" or "en_US".
Is there anything simple which can be implemented to make the program more tolerant of other locales?
The text was updated successfully, but these errors were encountered: