5 votes

Python3 Avertissement d'exécution : le buffering par ligne (buffering=1) n'est pas pris en charge en mode binaire, la taille de buffer par défaut sera utilisée

J'ai récemment mis à jour mon Ubuntu de 19.10 à 20.04. Pendant l'installation et maintenant lorsque j'exécute apt update, je vois des avertissements liés à 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)

Comment puis-je résoudre cela ?

4voto

Crashbit Points 41

Ici, vous pouvez voir une discussion à ce sujet :

Et voici une solution :

Mais rappelez-vous ... ce n'est pas un bug, c'est une fonctionnalité :)

0voto

edam Points 160

Je n'ai aucun problème avec "apt update" en 20.4

shell> cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"

Dans mon cas, le problème a été causé par le plugin Ansible mitogen

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: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used return io.open(fd, *args, **kwargs)

Le problème a disparu lorsque j'ai désactivé mitogen

shell> grep strategy ansible.cfg 
# strategy = mitogen_linear

SistemesEz.com

SystemesEZ est une communauté de sysadmins où vous pouvez résoudre vos problèmes et vos doutes. Vous pouvez consulter les questions des autres sysadmins, poser vos propres questions ou résoudre celles des autres.

Powered by:

X