同步源码,问题重现:

 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. OC NSFileHandle(文件内容操作)

    OC NSFileHandle(文件内容操作) 初始化 [NSFileHandle fileHandleForUpdatingAtPath:@"data.txt"]; //file ...

  2. footer置底

    html代码: <div class="container"> <div cass="header"></div> < ...

  3. org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

    org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not a ...

  4. alpha-beta剪枝搜索

    •一种基于剪枝( α-βcut-off)的深度优先搜索(depth-first search). •将走棋方定为MAX方,因为它选择着法时总是对其子节点的评估值取极大值,即选择对自己最为有利的着法: ...

  5. 0032 Java学习笔记-类加载机制-初步

    JVM虚拟机 Java虚拟机有自己完善的硬件架构(处理器.堆栈.寄存器等)和指令系统 Java虚拟机是一种能运行Java bytecode的虚拟机 JVM并非专属于Java语言,只要生成的编译文件能匹 ...

  6. 0026 Java学习笔记-面向对象-抽象类、接口

    抽象方法与抽象类 抽象方法用abstract修饰,没有方法体部分,连花括号都不能有: 抽象方法和抽象类都用abstract修饰 包含抽象方法的类一定是抽象类:但不包含抽象方法的类也可以是抽象类 不能创 ...

  7. Windows下配置Squid反向代理服务器

    Squid是一款类Unix系统下非常流行的服务器软件,其最重要的功能就是在客户端和服务端之间建立缓存.因而Squid可以用作反向代理,部署多级缓存或者搭建CDN等,无论名称是什么,本质上都是一样的.目 ...

  8. 【推荐】CentOS安装Tomcat-7.0.57+启动配置+安全配置+性能配置

    注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Tomcat之前,请确保已经安装了JDK-1.7环境,具体见<CentOS安装JDK-1.7>. ...

  9. POJ2484 A Funny Game[博弈论]

    A Funny Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5401   Accepted: 3381 Desc ...

  10. Java中单例

    Java中单例模式是一种常见的设计模式,单例模式的写法有好几种,这里主要介绍两种:懒汉式单例.饿汉式单例 单例模式有以下特点: 1.单例类只能有一个实例. 2.单例类必须自己创建自己的唯一实例. 3. ...