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

locale.Error: unsupported locale setting #193

Closed
ignatenkobrain opened this issue Sep 3, 2016 · 5 comments
Closed

locale.Error: unsupported locale setting #193

ignatenkobrain opened this issue Sep 3, 2016 · 5 comments

Comments

@ignatenkobrain
Copy link

======================================================================
ERROR: test_DecimalField (tests.tests_fields.FieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/tests/tests_fields.py", line 203, in test_DecimalField
    with rows.locale_context(locale_name):
  File "/usr/lib64/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/rows/localization.py", line 23, in locale_context
    locale.setlocale(category, name)
  File "/usr/lib64/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

======================================================================
ERROR: test_FloatField (tests.tests_fields.FieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/tests/tests_fields.py", line 171, in test_FloatField
    with rows.locale_context(locale_name):
  File "/usr/lib64/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/rows/localization.py", line 23, in locale_context
    locale.setlocale(category, name)
  File "/usr/lib64/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

======================================================================
ERROR: test_IntegerField (tests.tests_fields.FieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/tests/tests_fields.py", line 144, in test_IntegerField
    with rows.locale_context(locale_name):
  File "/usr/lib64/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/rows/localization.py", line 23, in locale_context
    locale.setlocale(category, name)
  File "/usr/lib64/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

======================================================================
ERROR: test_PercentField (tests.tests_fields.FieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/tests/tests_fields.py", line 250, in test_PercentField
    with rows.locale_context(locale_name):
  File "/usr/lib64/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/rows/localization.py", line 23, in locale_context
    locale.setlocale(category, name)
  File "/usr/lib64/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

======================================================================
ERROR: test_locale_context (tests.tests_localization.LocalizationTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/tests/tests_localization.py", line 41, in test_locale_context
    with locale_context(name):
  File "/usr/lib64/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/brain/git/fedora/python-rows/rows-0.3.0/rows/localization.py", line 23, in locale_context
    locale.setlocale(category, name)
  File "/usr/lib64/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
@turicas
Copy link
Owner

turicas commented Sep 3, 2016

@ignatenkobrain, thanks for creating the issue.
Did you install all needed locales to run the tests? Brazilian Portuguese is needed.
I've run all tests on Python 3.5.2 and everything worked properly.

@ignatenkobrain
Copy link
Author

I'm not sure what to install. Basically it's normal python installation.

@turicas
Copy link
Owner

turicas commented Sep 5, 2016

@ignatenkobrain you need the pt_BR.UTF-8 locale installed on your system to run the tests properly, since there's a localization feature in the library and the tests depend on a different locale (pt_BR.UTF-8, in this case).
You can install it by running the following commands:

echo 'pt_BR.UTF-8 UTF-8' >> /etc/locale.gen
/usr/sbin/locale-gen

Can you please test it?

@turicas
Copy link
Owner

turicas commented Sep 5, 2016

Note: these commands work on Debian, I don't know about Fedora (is the locale.gen is inside the same directory).

@ignatenkobrain
Copy link
Author

I added glibc-langpack-pt and it fixed problem. Thanks for advise!

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

2 participants