1. Mikhail Korobov
  2. django-webtest
Issue #21 wontfix

click() crashes with UTF-8 links

Laurent Payot
created an issue

For instance

page2 = page1.click("Éditer")

gives me the following result:

/usr/lib/python3.3/http/cookiejar.py:1588: UserWarning: http.cookiejar bug!
Traceback (most recent call last):
  File "/usr/lib/python3.3/http/cookiejar.py", line 1586, in make_cookies
    parse_ns_headers(ns_hdrs), request)
  File "/usr/lib/python3.3/http/cookiejar.py", line 1543, in _cookies_from_attrs_set
    cookie = self._cookie_from_cookie_tuple(tup, request)
  File "/usr/lib/python3.3/http/cookiejar.py", line 1492, in _cookie_from_cookie_tuple
    req_host, erhn = eff_request_host(request)
  File "/usr/lib/python3.3/http/cookiejar.py", line 612, in eff_request_host
    erhn = req_host = request_host(request)
  File "/usr/lib/python3.3/http/cookiejar.py", line 597, in request_host
    url = request.get_full_url()
  File "/usr/local/lib/python3.3/dist-packages/WebTest-2.0.8.dev0-py3.3.egg/webtest/utils.py", line 116, in get_full_url
    return self._request.url
  File "/usr/local/lib/python3.3/dist-packages/WebOb-1.2.3-py3.3.egg/webob/request.py", line 505, in url
    url = self.path_url
  File "/usr/local/lib/python3.3/dist-packages/WebOb-1.2.3-py3.3.egg/webob/request.py", line 477, in path_url
    bpath_info = bytes_(self.path_info, self.url_encoding)
  File "/usr/local/lib/python3.3/dist-packages/WebOb-1.2.3-py3.3.egg/webob/descriptors.py", line 68, in fget
    return req.encget(key, encattr=encattr)
  File "/usr/local/lib/python3.3/dist-packages/WebOb-1.2.3-py3.3.egg/webob/request.py", line 167, in encget
    return bytes_(val, 'latin-1').decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 5: invalid continuation byte

  _warn_unhandled_exception()

Same result if I use regex such as click(".diter"). Should I directly create a ticket at the webtest project??

I'm using Ubuntu 13.04 64 bit and Python 3.3.1 with the last commit of django, the last commit of webtest and the last commit of django-webtest.

Comments (2)

  1. Log in to comment