Failes when searching repository with multi-byte characters

Issue #3 resolved
Atsushi Kanaya repo owner created an issue

See the log below:

/search?name=%E7%A2%BA%E8%AA%8D 500 43ms 0kb Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 module=default version=1
113.37.30.210 - - [02/Jun/2014:18:12:43 -0700] "GET /search?name=%E7%A2%BA%E8%AA%8D HTTP/1.1" 500 264 "http://osschecker.appspot.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36" "osschecker.appspot.com" ms=43 cpu_ms=0 cpm_usd=0.000030 app_engine_release=1.9.5 instance=00c61b117c6d761d8238a18106b6748537fee7
E 2014-06-03 01:12:43.871
Exception on /search [GET]
Traceback (most recent call last):
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/osschecker.py", line 28, in search
    github_repositories = GitHubSearchService().find_by_name(request.args.get('name'))
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/domain/github_search_service.py", line 31, in find_by_name
    for repository in self.github.search_repositories(name)]
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/github/PaginatedList.py", line 48, in __iter__
    newElements = self._grow()
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/github/PaginatedList.py", line 60, in _grow
    newElements = self._fetchNextPage()
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/github/PaginatedList.py", line 158, in _fetchNextPage
    parameters=self.__nextParams
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/github/Requester.py", line 169, in requestJsonAndCheck
    return self.__check(*self.requestJson(verb, url, parameters, headers, input, cnx))
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/github/Requester.py", line 210, in requestJson
    return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode)
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/github/Requester.py", line 239, in __requestEncode
    url = self.__addParametersToUrl(url, parameters)
  File "/base/data/home/apps/s~osschecker/1.376272926737131659/lib/github/Requester.py", line 312, in __addParametersToUrl
    return url + "?" + urllib.urlencode(parameters)
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/urllib.py", line 1307, in urlencode
    v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

Comments (2)

  1. Log in to comment