If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[traceback] UnicodeEncodeError: 'ascii' codec can't encode character u'\u200c' in position 1: ordinal not in range - mkt.carriers.middleware

VERIFIED FIXED in 2013-09-24

Status

Marketplace
General
P4
normal
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: mat, Assigned: cvan)

Tracking

2013-09-24
Points:
---

Details

(Reporter)

Description

4 years ago
http://sentry.mktmon.services.phx1.mozilla.com/mkt/marketplacefirefoxcom/group/1201/

UnicodeEncodeError: 'ascii' codec can't encode character u'\u200c' in position 1: ordinal not in range(128)

Stacktrace (most recent call last):

  File "django/core/handlers/base.py", line 89, in get_response
    response = middleware_method(request)
  File "mkt/carriers/middleware.py", line 56, in process_request
    return redirect(urlparams(new_path, carrier=carrier))
  File "django/shortcuts/__init__.py", line 75, in redirect
    return redirect_class(urlresolvers.reverse(to, args=args, kwargs=kwargs))
  File "amo/urlresolvers.py", line 62, in reverse
    url = django_reverse(viewname, urlconf, args, kwargs, prefix, current_app)
  File "django/core/urlresolvers.py", line 476, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
  File "django/core/urlresolvers.py", line 360, in _reverse_with_prefix
    lookup_view = get_callable(lookup_view, True)
  File "django/utils/functional.py", line 27, in wrapper
    result = func(*args)
  File "django/core/urlresolvers.py", line 92, in get_callable
    lookup_view = getattr(import_module(mod_name), func_name)
  File "django/utils/importlib.py", line 35, in import_module
    __import__(name)


Relevant code:

        if carrier and is_legacy:
            orig_path = request.path_info
            new_path = orig_path[len(carrier) + 1:] or '/'
            return redirect(urlparams(new_path, carrier=carrier))


I guess just doing new_path.encode('utf-8') would fix it. I don't think the error happens with real users, it's just script kiddies or whatever trying to find vulnerabilities (the URL here is https://marketplace.firefox.com/telefonica/%E2%80%8C.htaccess ) but we should fix it anyway, 500ing is bad.
(Assignee)

Updated

4 years ago
Assignee: nobody → cvan
Target Milestone: --- → 2013-09-17
(Assignee)

Comment 1

4 years ago
https://github.com/mozilla/zamboni/commit/d23a11c
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: 2013-09-17 → 2013-09-24

Comment 2

4 years ago
verified fixed at https://marketplace-dev.allizom.org/telefonica/%E2%80%8C.htaccess

[16:38:28.248] GET https://marketplace-dev.allizom.org/telefonica/%E2%80%8C.htaccess [HTTP/1.1 404 NOT FOUND 185ms]
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.