同步源码,问题重现:

 Fetching project platform/external/libopus
Fetching project repo
error: Cannot fetch repo (TypeError: expected string or buffer)
Fetching project CyanogenMod/android_external_tinycompress
Exception in thread Thread-:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line , in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line , in run
self.__target(*self.__args, **self.__kwargs)
File "/home/dinphy/sm/.repo/repo/subcmds/sync.py", line , in _FetchProjectList
success = self._FetchHelper(opt, project, *args, **kwargs)
File "/home/dinphy/sm/.repo/repo/subcmds/sync.py", line , in _FetchHelper
prune=opt.prune)
File "/home/dinphy/sm/.repo/repo/project.py", line , in Sync_NetworkHalf
no_tags=no_tags, prune=prune)):
File "/home/dinphy/sm/.repo/repo/project.py", line , in _RemoteFetch
if remote.PreConnectFetch():
File "/home/dinphy/sm/.repo/repo/git_config.py", line , in PreConnectFetch
return _preconnect(connectionUrl)
File "/home/dinphy/sm/.repo/repo/git_config.py", line , in _preconnect
m = URI_ALL.match(url)
TypeError: expected string or buffer

分析问题,寻找方案:

1、问题所在:主要是repo的问题,只需要重新下载repo即可。

2、下载repo需要IP代理,http://www.cnblogs.com/dinphy/p/5619854.html

3、终端输入命令重新下载repo并初始化:

#新建bin目录
mkdir ~/bin #指定路径
PATH=~/bin:$PATH #下载repo,并移动到bin目录下
curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo #给repo赋予读写权限
chmod a+x ~/bin/repo

4、回到项目的目录,重新初始化源码,然后repo sync

5、OK,完美结束。

解决:error: Cannot fetch repo (TypeError: expected string or buffer)的更多相关文章

  1. TypeError: expected string or buffer的解决方法

    错误种类:TypeError: expected string or buffer 具体错误解释:这是因为返回的变量不是字符类型,而导致此错误 具体解决方法:在具体程序段前加if判断语句,判断程序返回 ...

  2. a=re.findall('b',c)报错提示:TypeError:expected string or buffer

    目的:想通过findall选取某个unicode编码的字符串列表(列表里面有元组) 问题:报错[TypeError:expected string or buffer] 现在测试下: 定义一个有元组的 ...

  3. 关于Python json解析过程遇到的TypeError: expected string or buffer

    关于Python json解析过程遇到的问题:(爬取天气json数据所遇到的问题http://tianqi.2345.com/) part.1 url——http://tianqi.2345.com/ ...

  4. 导入json文件报错,TypeError expected string or buffer

    导入json文件报错,TypeError expected string or buffer 原因:用字符串赋值后,python会把双引号转换为单引号 import json data = [{&qu ...

  5. 解决:return _compile(pattern, flags).search(string) TypeError: expected string or buffer

    今天写爬虫,爬取MM图片页面的标题时,遇到了一个问题,上图: 看看我的代码: import urllib import urllib2 import re class JPMSG: def __ini ...

  6. [Python]json对象转换出错expected string or buffer python

    [问题] 今天在使用python中的json转换碰到一个问题: 错误显示: expected string or buffer json内容如下: {u'err_no': 0, u'corpus_no ...

  7. TypeError: expected string or bytes-like object

    在写Python代码的时候,遇到了"TypeError: a bytes-like object is required, not 'str'"错误,此处实验机器的Python环境 ...

  8. html内容写入到文件中的时候出现‘TypeError: expected a character buffer object’错误

    代码如下: with open('ryf.md', 'a') as f: f.write(content) # content是html内容 原因是写入文件要求写入内容是str,直接转换成str即可, ...

  9. TypeError: sequence item 0: expected string, Tag found

    原始代码: soup = BeautifulSoup(result, 'html.parser') content_list = soup.find_all('p', attrs={"cla ...

随机推荐

  1. Linux系统安装NoSQL(MongoDB和Redis)步骤及问题解决办法

    ➠更多技术干货请戳:听云博客 如下是我工作中的记录,介绍的是linux系统下NoSQL:MongoDB和Redis的安装过程和遇到的问题以及解决办法: 需要的朋友可以按照如下步骤进行安装,可以快速安装 ...

  2. iOS程序破解——获取.ipa程序包

    原文在此 首先肯定不是获取自己的ipa包. 为什么要获取ipa包呢?比如,在仿写一些程序时,避免不了获取它的图片素材等等,那么最快也是最有效的方式就是获取原程序的ipa包.更或者,你想要逆向分析某一款 ...

  3. iOS之UICollectionView详解

    UICollectionView是一种类似于UITableView但又比UITableView功能更强大.更灵活的视图,这是源于它将UICollectionView对cell的布局交给了UIColle ...

  4. Java暗箱操作之enum

    enum,即枚举类型,在每种编程语言中都有类似的类型. 因为用得少,语法规则很难记得住,我每次看到enum都会感到害怕. 一般的enum语法是这样的: public class MyClass { p ...

  5. python头部注释 vim添加头部注释

    1.先说说python和virtual python 一般环境下,python解释器会放在/usr/bin/ 下面,然后你执行python的时候就会运行了,但是如果没有在/usr/bin/下面的话,执 ...

  6. SqlServer--查询案例

    use  MyDataBase1 -- * 表示显示所有列 -- 查询语句没有加where条件表示查询所有行 select *from TblStudent ---只查询表中的部分列 select t ...

  7. String.SubString

    1理论 String.SubString(int index,int length) index:开始位置,从0开始 length:你要取的子字符串的长度 2实验   string my = &quo ...

  8. Oracle Linux(64位)安装64位Oracle10g遇到ins_ctx.mk问题

    在Oracle Linux Server Release 5.7上安装64位Oracle 10g 时,遇到如下问题: Error in invoking target 'install' of mak ...

  9. SQL Server 2008 R2——用CTE进行递归计算求解累计值

    =================================版权声明================================= 版权声明:原创文章 谢绝转载  请通过右侧公告中的“联系邮 ...

  10. mysql启动失败:不能创建pid文件

    2016-03-09T07:51:38.905444Z 0 [ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/run/mysqld/ ...