From 91b0421d9b9033f78d8cf56c5738d6ee90ef452c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Si=C3=B1uela=20Pastor?= Date: Fri, 10 Jan 2020 14:17:03 +0100 Subject: [PATCH] Request text mode to Popen to avoid buffering warning (python 3.8) Python 3.8 started reporting warnings when binary files are opened with bufsize > 0, see https://bugs.python.org/issue32236 for the change and https://github.com/benoitc/gunicorn/issues/2091 for a similar issue. The error message was: py.warnings: WARNING: /usr/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used --- conans/client/conf/detect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conans/client/conf/detect.py b/conans/client/conf/detect.py index 1b3310d6e2f..de0b8601f72 100644 --- a/conans/client/conf/detect.py +++ b/conans/client/conf/detect.py @@ -10,7 +10,8 @@ def _execute(command): - proc = Popen(command, shell=True, bufsize=1, stdout=PIPE, stderr=STDOUT) + proc = Popen(command, shell=True, bufsize=1, universal_newlines=True, stdout=PIPE, + stderr=STDOUT) output_buffer = [] while True: