hejq0310 / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

UnicodeDecodeError when path in UTF-8 #148

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have same error as olibre:
http://stackoverflow.com/questions/18049320

Reproduce:

    mkdir café_is_UTF8_not_ASCII
    cd    café_is_UTF8_not_ASCII
    repo init

Failure:

    UnicodeDecodeError: 'ascii' codec can't decode byte [...]

Proposed fix is to put bellow lines at the script beginning:

    import sys
    import codecs
    sys.stdout = codecs.getwriter('utf8')(sys.stdout)

Refer to:
http://stackoverflow.com/a/1169209/938111

Original issue reported on code.google.com by oliver.h...@gmail.com on 3 Sep 2013 at 3:12