同步源码,问题重现:

 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. IOS开发基础知识--碎片25

    1:使用@protocol实现delegate和datasource模式 #import <UIKit/UIKit.h> @protocol MyViewDataSource,MyView ...

  2. android adb pull push

    adb命令下pull的作用是从手机端向电脑端拷文件. adb pull /storage/emulated/0/Download/**.apk  /Users/edwin/Downloads adb命 ...

  3. Red Hat Enterprise Linux 6.6安装体验

    Red Hat Enterprise Linux 6.6的安装首界面有五个选项,这跟以前的Red Hat Enterprise Linux 5.x的安装界面是有一些区别的.   安装或者升级现有系统( ...

  4. SQL Server 关于列的权限控制

    在SQL SERVER中列权限(Column Permissions)其实真没有什么好说的,但是好多人对这个都不甚了解,已经被人问了几次了,所以还是在这里介绍一下,很多人都会问,我能否单独对表的某列授 ...

  5. Mybatis整合Spring

    根据官方的说法,在ibatis3,也就是Mybatis3问世之前,Spring3的开发工作就已经完成了,所以Spring3中还是没有对Mybatis3的支持.因此由Mybatis社区自己开发了一个My ...

  6. jmeter接口自动化集成

    接口自动化集成 一.jmeter基础学习 1.博客  :http://www.cnblogs.com/fnng/category/345478.html 2.博客   http://www.cnblo ...

  7. Android资源(图片)命名规范

    (转自:http://www.jb51.net/article/38796.htm) 图片命名注意: 1,不能以下划线("_")开头: 2,以数字加下划线("[0-9]_ ...

  8. Linux配置本地无密码访问

    本机配置无密码访问基本操作步骤: 1.ssh-keygen (效果同ssh-keygen -t rsa 一样,也可以ssh-keygen -t dsa) 2.ssh-copy-id -i ~/.ssh ...

  9. Python class and function json

    # coding=utf-8 __author__ = 'student' ''' how to define a class how to extend a class how to make a ...

  10. struts2的拦截器(Interceptor)与过滤器(Filter)

    一.拦截器与过滤器的区别: 1.filter基于回调函数,我们需要实现的filter接口中doFilter方法就是回调函数,而interceptor则基于Java本身的反射机制,这是两者最本质的区别. ...