UrlHelper fail to initialize when full_path contains unicode query string

Issue #7 new
tim feirg
created an issue

when url query string contains urlencoded unicode characters, initializing a UrlHelper with this url will cause UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128), here's how to reproduce

from url_tools.helper import UrlHelper
url = u'/dashboard/product/?q=%E5%BE%88%E5%A5%BD'
# this will pass
a = UrlHelper(str(url))
# and this will fail
a = UrlHelper(url)

Comments (0)

  1. Log in to comment