filepath_to_uri raises UnicodeDecodeError on utf8 input
The docs say "The path is assumed to be either UTF-8 or unicode." in https://docs.djangoproject.com/en/1.5/ref/utils/#django.utils.encoding.filepath_to_uri:
>>> filepath_to_uri('тест')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/kanobu/env/lib/python2.7/site-packages/django/utils/encoding.py", line 235, in filepath_to_uri
return quote(force_bytes(path.replace("\\", "/")), safe=b"/~!*()'")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
Since the module django.utils.encoding
uses unicode literals, code path.replace("\", "/")
fails, because it tries to decode path
fix with tests