Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Request text mode to Popen to avoid buffering warning (python 3.8) #6333

Merged

Conversation

david-sinuela-pix4d
Copy link
Contributor

@david-sinuela-pix4d david-sinuela-pix4d commented Jan 10, 2020

Changelog: Fix: Avoid warning in "detect" process with Python 3.8, due to Popen with bufsize=1
Docs: omit

Closes #6332

This is a possible solution to the issue, the other one is to remove the bufsize argument but seeing that the code parses line by line this seems more appropriate.

From the commit message:

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


  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • [x I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

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
@memsharded
Copy link
Member

@memsharded memsharded commented Jan 10, 2020

I am testing this locally too on Windows. Why adding the universal_lines instead of dropping the bufsize=1? It also seems to work, and the offender is apparently the bufsize

@david-sinuela-pix4d
Copy link
Contributor Author

@david-sinuela-pix4d david-sinuela-pix4d commented Jan 10, 2020

Both would work I think, the lines below do line-wise processing that's why I preferred this approach but I can change it. Let me know.

@memsharded memsharded added this to the 1.22 milestone Jan 12, 2020
@memsharded
Copy link
Member

@memsharded memsharded commented Jan 12, 2020

Sure, lets merge it, many thanks!

@memsharded memsharded merged commit 5889bfd into conan-io:develop Jan 12, 2020
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants