- Python Home
- About
- News
- Documentation
- Downloads
- Community
- Foundation
- Developer's Guide
- Issue Tracker
- Issues
- Summaries
- User
- Administration
- Help
➜
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2018-03-27 10:54 by acue, last changed 2022-04-11 14:58 by admin.
| Files | |||
|---|---|---|---|
| File name | Uploaded | Description | Edit |
| python3-output.txt | acue, 2018-03-27 10:54 | output of warnings during unittest of command line tool by stderr |
| Messages (3) | ||
|---|---|---|
| msg314511 - (view) | Author: Arno-Can Uestuensoez (acue) | Date: 2018-03-27 10:54 |
The subprocess call *subprocess.Popen* in Python3.6 was added a number of resource warnings, including subprocess run-state and open files. This is a very good facility for debugging, but causes a lot of trouble for programs relying on subprocesses via the STDIO/STDERR interface. The STDIO/STDERR interfaces are very common when shell utilities are incorporated into high level Python programs. The other issue is the unit testing of command line tools as black-box tests, these solely rely on the STDOUT and STDERR interface. I am currently finishing a subprocess test package with common code for Python2.7 and Python3.5+, so facing some trouble with IO filtering. Examples are attached. A system call should process the common IO interfaces of the called subprocesses by default without any additional output. So a call flag and/or an environment variable should be introduced in addition, which allows the activation and deactivation of these messages. The default should be *deactive*. |
||
| msg314513 - (view) | Author: Arno-Can Uestuensoez (acue) | Date: 2018-03-27 10:59 |
See also issue26741 - subprocess.Popen should emit a ResourceWarning in destructor if ... |
||
| msg322136 - (view) | Author: Martin Panter (martin.panter) * ![]() |
Date: 2018-07-22 08:30 |
Can’t you use Python’s existing CLI <https://docs.python.org/3.6/using/cmdline.html#cmdoption-w> and environment variable <https://docs.python.org/3.6/using/cmdline.html#envvar-PYTHONWARNINGS> to control the ResourceWarning messages? Warnings where enabled by default when using the “unittest” module in Issue 10535. There is probably a way to disable them, at least by using the “warnings” module directly. But I think ResourceWarning should stay enabled by default when running tests. As you said, the warnings help testing for bugs. |
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:59 | admin | set | github: 77335 |
| 2018-07-22 08:30:40 | martin.panter | set | messages: + msg322136 |
| 2018-03-27 10:59:31 | acue | set | messages: + msg314513 |
| 2018-03-27 10:54:43 | acue | create |
Powered by Roundup Copyright © 1990-2022, Python Software Foundation
Legal Statements

