1. 環境
本人 Win7 64bit,使用的cygwin
也爲64bit,爲了在 windows 下使用 repo
命令,安裝了git
,python
。
2. 問題
在使用repo init
的時候出現了下面的問題:
File "/cygdrive/d/xxx/.repo/repo/project.py", line 2486 , in runner
r = r.decode('utf-8')
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb3 in position 0: invalid s tart byte
3. 分析解決
從打印上來看應該是編碼的問題,google
了一下,找到這個鏈接。結合自己的情況將project.py
對應的錯誤處進行了如下修改:
1. 將'utf-8'
替換爲 sys.getfilesystemencoding()
2. 刪除文件下的 manifest.git
文件夾
3. 重新repo init
4. 結語
repo
就是一個 python
腳本用來管理多git
倉庫,所有如果它遇到問題,直接去修改對應的python
腳本即可。