UnicodeEncodeError in make_option_unique_id

Create issue
Issue #1156 resolved
Former user created an issue

I have simbols like '()' in product options list and i have error on product page: (trunk version)

Environment:

Request Method: GET Request URL: http://mikita-kids.axion-rti.ru/product/A0100_002/ Django Version: 1.2 rc 1 Python Version: 2.6.5 Installed Applications: ['grappelli', 'filebrowser', 'satchmo_store.shop', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.comments', 'django.contrib.sessions', 'django.contrib.sitemaps', 'django.contrib.sites', 'registration', 'sorl.thumbnail', 'keyedcache', 'livesettings', 'satchmo_store.contact', 'product', 'product.modules.configurable', 'shipping', 'payment', 'payment.modules.dummy', 'payment.modules.giftcertificate', 'satchmo_store.contact.supplier', 'satchmo_utils', 'satchmo_utils.thumbnail', 'l10n', 'tax', 'satchmo_ext.wishlist', 'satchmo_ext.upsell', 'satchmo_ext.productratings', 'app_plugins', 'south', 'debug_toolbar'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.middleware.doc.XViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'threaded_multihost.middleware.ThreadLocalMiddleware', 'satchmo_store.shop.SSLMiddleware.SSLRedirect', 'debug_toolbar.middleware.DebugToolbarMiddleware')

Traceback: File "/var/www/vhosts/mikita-kids.axion-rti.ru/3rdparty/apps/django/core/handlers/base.py" in get_response 100. response = callback(request, *callback_args, callback_kwargs) File "/var/www/vhosts/mikita-kids.axion-rti.ru/3rdparty/apps/product/views/__init__.py" in get_product 152. default_view_tax=default_view_tax) File "/var/www/vhosts/mikita-kids.axion-rti.ru/3rdparty/apps/product/models.py" in add_template_context 1170. context = subtype.add_template_context(context, *args, kwargs) File "/var/www/vhosts/mikita-kids.axion-rti.ru/3rdparty/apps/product/modules/configurable/models.py" in add_template_context 214. context['options'] = serialize_options(self, selected_options) File "/var/www/vhosts/mikita-kids.axion-rti.ru/3rdparty/apps/product/utils.py" in serialize_options 162. all_options = product.get_valid_options() File "/var/www/vhosts/mikita-kids.axion-rti.ru/3rdparty/apps/product/modules/configurable/models.py" in get_valid_options 90. all_options = get_all_options(self, ids_only=True) File "/var/www/vhosts/mikita-kids.axion-rti.ru/3rdparty/apps/product/modules/configurable/models.py" in get_all_options 41. sublist.append(value.unique_id) File "/var/www/vhosts/mikita-kids.axion-rti.ru/3rdparty/apps/product/models.py" in _get_unique_id 752. return make_option_unique_id(self.option_group_id, self.value) File "/var/www/vhosts/mikita-kids.axion-rti.ru/3rdparty/apps/product/models.py" in make_option_unique_id 1548. return '%s-%s' % (str(groupid), str(value),)

Exception Type: UnicodeEncodeError at /product/A0100_002/ Exception Value: 'ascii' codec can't encode character u'\u0410' in position 0: ordinal not in range(128)

Comments (2)

  1. Log in to comment