RV1126源码编译的时候报错TypeError: a bytes-like object is required, not ‘str‘

记录下解决方案,

在这里插入图片描述
上图来源:https://wiki.t-firefly.com/zh_CN/CORE-1126-JD4/Source_code.html
按照官网的教程,走到红框那一步的时候开始报错,
在这里插入图片描述
这是第一个错误,我的解决方法是直接找到路径下的.repo/repo/git_config.py", line 299,这里第299行,直接把
原本的.decode(‘utf-8’)删除,变成下面这个
在这里插入图片描述
然后顺利通过

之后会报新的错误
在这里插入图片描述
TypeError: a bytes-like object is required, not ‘str’

我的解决方案是,
把:out = iter(out[:-1].split(‘\0’))
改成:out = iter(out[:-1].split(‘\0’.encode(encoding=‘utf-8’)))

亲测有效

后面还有
在这里插入图片描述
也一样,改成info = info[1:].split(’ '.encode(encoding=‘utf-8’))

紧接着,继续报新的错:
在这里插入图片描述
解决方案我参考的这里:
https://jingyan.baidu.com/article/546ae185de47961149f28cb7.html
亲测有效

接着,继续报错:
在这里插入图片描述
老办法
将:proc.stdin.write(MAINTAINER_KEYS)
改成:proc.stdin.write(MAINTAINER_KEYS.encode(encoding=‘utf-8’))

再重新运行,终于,顺利执行完毕。

D:\python3.11.5\Lib\site-packages\urllib3\connectionpool.py:1099: InsecureRequestWarning: Unverified HTTPS request is being made to host 'api.deepseek.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings warnings.warn( Error: 404 2025-06-28 15:25:28,204 - INFO - 127.0.0.1 - - [28/Jun/2025 15:25:28] "POST /multi_question HTTP/1.1" 500 - Traceback (most recent call last): File "D:\python3.11.5\Lib\site-packages\flask\app.py", line 1536, in __call__ return self.wsgi_app(environ, start_response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python3.11.5\Lib\site-packages\flask\app.py", line 1514, in wsgi_app response = self.handle_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python3.11.5\Lib\site-packages\flask_cors\extension.py", line 176, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "D:\python3.11.5\Lib\site-packages\flask\app.py", line 1511, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python3.11.5\Lib\site-packages\flask\app.py", line 919, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python3.11.5\Lib\site-packages\flask_cors\extension.py", line 176, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "D:\python3.11.5\Lib\site-packages\flask\app.py", line 917, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python3.11.5\Lib\site-packages\flask\app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\code\python\coursedesign\IntelliQ\app.py", line 22, in api_multi_question response = chatbot_model.process_multi_question(question) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\code\python\coursedesign\IntelliQ\models\chatbot_model.py", line 91, in process_multi_question self.recognize_intent(user_input) File "D:\code\python\coursedesign\IntelliQ\models\chatbot_model.py", line 55, in recognize_intent user_choices = extract_continuous_digits(user_choice) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\code\python\coursedesign\IntelliQ\utils\data_format_utils.py", line 27, in extract_continuous_digits continuous_digits = re.findall(r'\d+', text) ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python3.11.5\Lib\re\__init__.py", line 216, in findall return _compile(pattern, flags).findall(string) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'NoneType' 这个怎么改
最新发布
06-29
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值