Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

LC_MONETARY issue in OpenBSD 5.5 #192

Open
procmail opened this issue Jul 7, 2014 · 0 comments
Open

LC_MONETARY issue in OpenBSD 5.5 #192

procmail opened this issue Jul 7, 2014 · 0 comments

Comments

@procmail
Copy link

procmail commented Jul 7, 2014

Hi,

In OpenBSD 5.5, it seems that LC_MONETARY only supports the values of "", "C" and "POSIX".

Therefore, in the file cartridge/shop/utils.py:

if setlocale(LC_MONETARY, currency_locale) == "C":

This raises an exception:
django.core.exceptions.ImproperlyConfigured: Invalid currency locale specified for SHOP_CURRENCY_LOCALE: 'en_GB.UTF-8'. You'll need to set the locale for your system, or configure the SHOP_CURRENCY_LOCALE setting in your settings module.

(test)-bash-4.3$ locale -a|grep 'en_GB'
en_GB.ISO8859-1
en_GB.ISO8859-15
en_GB.UTF-8

Here's an example:
(test)-bash-4.2# python2.7

Python 2.7.6 (default, Mar 4 2014, 10:29:45)

[GCC 4.2.1 20070719 ] on openbsd5

Type "help", "copyright", "credits" or "license" for more information.

import locale

locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') ## This works

'C/en_US.UTF-8/C/C/C/en_US.UTF-8'

locale.setlocale(locale.LC_MONETARY, 'en_US.UTF-8') ## This does not work

Traceback (most recent call last):

File "", line 1, in

File "/usr/local/lib/python2.7/locale.py", line 547, in setlocale

return _setlocale(category, locale)

locale.Error: unsupported locale setting

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant