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
…6333)

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 authored and memsharded committed Jan 12, 2020
1 parent 572b7cf commit 5889bfd
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 5889bfd

Please sign in to comment.