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
Save order fails with UnicodeEncodeError at /shop/checkout/ #212
Comments
Are you able to work out a fix? I can't reproduce the issue. |
It looks very similar to mine problem I wanted to report just now. It's caused by set_cookie in mezzanine/utils/views.py more specific in expires = datetime.strftime... because %a is used. My problem is caused when "remember me" is checked in checkout form and remember cookie has to be created. when using locale, (in my case sk_SK) this is the ouput of expires: It's very strange because Thursday is the only day where "local" charater is used so this problem occurs only once a week. |
my traceback (it looks these are actually two similar problems):Traceback (most recent call last): |
I also have this problem with RU locale, anybody know how to fix? |
yes, the root cause is the localization of _("Flat rate shipping") in RU locale which is used in cartridge/shop/checkout.py. This (localized) string is set to request as parameter and doesn't work well. I've just hot fixed it by removing localization - wyzex@531672b I think Stephen can propose something permanent for this. |
Again, I can't reproduce this - here's a screenshot of the order completion page with RU as the language code: http://cl.ly/Z5FF Again, I'd advise the correct fix being best provided by someone actually experiencing the issue. |
Closing this for now as I'm confident this isn't a Mezzanine/Cartridge bug. My best guess at this stage is an incorrect locale is defined for the actual Python environment. This might be misconfigured for Apache, supervisord, or any other number of components being used to run the actual application. |
Well, this issue was also happening for LANGUAGE_CODE = "es", but what stephenmcd mention (modify http://cl.ly/Z5FF), was really help form me 👍 |
Order save (last step on checkout) fails with UnicodeEncodeError
The string that could not be encoded/decoded was: Стоимость дост
it is the following string failed:
: checkout.py:40
msgid "Flat rate shipping"
This error is only occurred if localization is enabled (RU language).
Database is MySQL 5.1:0.2.17, charset is utf8_general_ci
Products, pages, variations are kept in Russian without issues.
LANGUAGE_CODE = "ru"
LANGUAGES = (
('ru', _('Russian')),
)
USE_I18N = True
Environment:
Request Method: POST
Request URL:
Django Version: 1.6.7
Python Version: 2.7.5
Installed Applications:
(u'mezzanine.boot',
u'django.contrib.auth',
u'django.contrib.contenttypes',
u'django.contrib.redirects',
u'django.contrib.sessions',
u'django.contrib.sites',
u'django.contrib.sitemaps',
u'django.contrib.staticfiles',
u'mhapp',
u'mhapp.mhtheme',
u'cartridge.shop',
u'mezzanine.conf',
u'mezzanine.core',
u'mezzanine.generic',
u'mezzanine.blog',
u'mezzanine.forms',
u'mezzanine.pages',
u'mezzanine.galleries',
u'mezzanine.accounts',
u'filebrowser_safe',
u'grappelli_safe',
u'django.contrib.admin',
u'django.contrib.comments')
Installed Middleware:
(u'django.contrib.sessions.middleware.SessionMiddleware',
u'django.middleware.locale.LocaleMiddleware',
u'django.contrib.auth.middleware.AuthenticationMiddleware',
u'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
u'django.middleware.common.CommonMiddleware',
u'django.middleware.csrf.CsrfViewMiddleware',
u'django.contrib.messages.middleware.MessageMiddleware',
u'cartridge.shop.middleware.ShopMiddleware',
u'mezzanine.core.request.CurrentRequestMiddleware',
u'mezzanine.core.middleware.TemplateForDeviceMiddleware',
u'mezzanine.core.middleware.TemplateForHostMiddleware',
u'mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware',
u'mezzanine.core.middleware.SitePermissionMiddleware',
u'mezzanine.pages.middleware.PageMiddleware')
Traceback:
File "/var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
Exception Type: UnicodeEncodeError at /shop/checkout/
Exception Value: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)
The text was updated successfully, but these errors were encountered: