idlesign / django-siteprefs

Reusable app for Django introducing site preferences system
https://github.com/idlesign/django-siteprefs
BSD 3-Clause "New" or "Revised" License
17 stars 6 forks source link

UnicodeEncodeError in siteprefs/utils.py when using Python 3.4 and siteprefs 0.3.2 #8

Closed KarolS closed 10 years ago

KarolS commented 10 years ago

The traceback ends as follows:

  File "/home/karols/domains/amicus.mydevil.net/public_python/faktury/settings.py", line 135, in <module>
    autodiscover_siteprefs()
  File "/home/karols/python3/lib/python3.4/site-packages/siteprefs/toolbox.py", line 94, in autodiscover_siteprefs
    register_admin_models()
  File "/home/karols/python3/lib/python3.4/site-packages/siteprefs/toolbox.py", line 80, in register_admin_models
    model_class = get_pref_model_class(app_label, prefs_items, get_app_prefs)
  File "/home/karols/python3/lib/python3.4/site-packages/siteprefs/utils.py", line 131, in get_pref_model_class
    print('%s -> %s' % (field_name, val_proxy.field.verbose_name))
UnicodeEncodeError: 'ascii' codec can't encode character '\u015b' in position 16: ordinal not in range(128)

'\u015b' is ś.

My code looks like following:

VAT_RATE = getattr(settings, 'VAT_RATE', 23)
register_prefs(
    pref_group("Opcje faktur", (
        pref(VAT_RATE, verbose_name="Domyślna stawka VAT", static=False),
    )),
)

I think it's fixed in master; when will it get packaged?

idlesign commented 10 years ago

Thank you for the report. Packaged.