Skip to content

Commit

Permalink
Request text mode to Popen to avoid buffering warning (python 3.8)
Browse files Browse the repository at this point in the history
Python 3.8 started reporting warnings when binary files are opened with
bufsize > 0, see https://bugs.python.org/issue32236 for the change and
benoitc/gunicorn#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
  • Loading branch information
david-sinuela-pix4d committed Jan 10, 2020
1 parent 812c8ec commit 91b0421
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conans/client/conf/detect.py
Expand Up @@ -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:
Expand Down

0 comments on commit 91b0421

Please sign in to comment.