#17 Lookaside: encoding repo name to UTF-8
Closed by lsedlar. Opened by araszka.
araszka/rpkg bz1241059  into  master

Download 17.patch
no initial comment

I don't like the proposed change:
- Find where the Unicode string firstly appeared and convert it there.
- Sources have unit tests so write a test to cover this issue

I would much prefer to only encode if url is actually a unicode instance. As is, the code would crash if someone has older GitPython (that returns strs), and the url actually contains non-ascii characters.

>>> "ščř".encode('utf-8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 0: ordinal not in range(128)

I have rebase the patch on master and merged.

Metadata