[issue33154] subprocess.Popen ResourceWarning should have activation-deactivation flags

2018-07-22 Thread Martin Panter

Martin Panter  added the comment:

Can’t you use Python’s existing CLI 
 and environment 
variable  
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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33154] subprocess.Popen ResourceWarning should have activation-deactivation flags

2018-03-27 Thread Arno-Can Uestuensoez

Arno-Can Uestuensoez  added the comment:

See also 
issue26741 - subprocess.Popen should emit a ResourceWarning in destructor if ...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33154] subprocess.Popen ResourceWarning should have activation-deactivation flags

2018-03-27 Thread Arno-Can Uestuensoez

New submission from Arno-Can Uestuensoez :

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*.

--
components: Library (Lib)
files: python3-output.txt
messages: 314511
nosy: acue, martin.panter, pitrou, python-dev, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: subprocess.Popen ResourceWarning should have activation-deactivation 
flags
type: resource usage
versions: Python 3.6
Added file: https://bugs.python.org/file47502/python3-output.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com