我最近将我的 Ubuntu 从 更新到19.10
了20.04
。在安装过程中以及现在运行时,apt update
我看到了与 python 相关的警告:
/usr/lib/python3.8/subprocess.py:838: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used self.stdin = io.open(p2cwrite, 'wb', bufsize)
我该如何修复它?
答案1
在这里,您可以看到有关此问题的讨论:
这里有一个修复:
但请记住...这不是一个错误,而是一个功能:)
答案2
我没有这样的问题“apt 更新”在 20.4
shell> cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
就我而言,问题是由 Ansible 插件引起的丝裂原
shell> ansible-playbook --version
ansible-playbook 2.9.6
config file = /home/admin/.ansible.cfg
configured module search path = ['/home/admin/.ansible/my_modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
shell> ansible localhost -m setup
/usr/lib/python3.8/os.py:1023: RuntimeWarning: 二进制模式下不支持行缓冲(buffering=1),将使用默认缓冲区大小返回 io.open(fd, *args, **kwargs)
当我禁用丝裂原时,问题消失了
shell> grep strategy ansible.cfg
# strategy = mitogen_linear