Page 1 of 1

locale.setlocale error in api.py, running on Drobo FS

Posted: March 27th, 2012, 4:09 pm
by meokey
I'm running sabnzbd on my Drobo FS and it goes great. Only one thing I have to change before it's able to run, for both 0.6.14 and the latest 0.6.15 versions:

I have to change the following lines in sabnzbd/api.py from

Code: Select all

import locale
locale.setlocale(locale.LC_ALL, "")
to

Code: Select all

DIR_LANGUAGE = None
import locale
locale.setlocale(locale.LC_ALL, DIR_LANGUAGE)
otherwise, it throw out an error when I click on Queue section on the web UI while sabnzbd seems still running:
Traceback (most recent call last):
File "/mnt/DroboFS/Shares/DroboApps/SABnzbdPlus/SABnzbd.py", line 65, in <module>
import sabnzbd
File "/mnt/DroboFS/Shares/DroboApps/SABnzbdPlus/sabnzbd/__init__.py", line 85, in <module>
import sabnzbd.api
File "/mnt/DroboFS/Shares/DroboApps/SABnzbdPlus/sabnzbd/api.py", line 29, in <module>
locale.setlocale(locale.LC_ALL, "")
File "/mnt/DroboFS/Shares/DroboApps/python2/lib/python2.7/locale.py", line 531, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
Any comment?

Re: locale.setlocale error in api.py, running on Drobo FS

Posted: March 27th, 2012, 4:42 pm
by shypike
It's a sign that your Python installation is incomplete.
Your patch is OK, although there might some minor internationalization issues.
The next release will handle this incompatibility.