[PyQt] Fix ResourceWarnings in configure.py of PyQt

Tiger-222 contact at tiger-222.fr
Mon Dec 17 10:22:10 GMT 2018


Hello,

I patched configure.py to prevent process leaks. I had this king of warning
for each and every PyQt component:
Generating the C++ source for the QtPrintSupport module....../sip OPTIONS
../PyQt5_gpl-5.12.dev1812131446/sip/QtPrintSupport/QtPrintSupportmod.sip/usr/lib/python3.6/subprocess.py:766:
ResourceWarning: subprocess 17168 is still running  ResourceWarning,
source=self)
If you are interested, this is the patch:
--- configure.py	2018-12-17 11:19:15.184585200 +0100+++ configure-patched.py
2018-12-17 11:18:54.340842077 +0100@@ -2085,7 +2085,7 @@ def
run_command(cmd, verbose):     if verbose:         sys.stdout.write(cmd +
"\n") -    fout = get_command_output(cmd, and_stderr=True)+    p, fout =
get_command_output(cmd, and_stderr=True)      # Read stdout and stderr until
there is no more output.     lout = fout.readline()@@ -2099,6 +2099,7 @@ def
run_command(cmd, verbose):         lout = fout.readline()      fout.close()+   
p.wait()      try:         os.wait()@@ -2171,7 +2172,7 @@ def
get_command_output(cmd, and_stderr=F     p = subprocess.Popen(cmd,
shell=True, stdin=subprocess.PIPE,             stdout=subprocess.PIPE,
stderr=stderr) -    return p.stdout+    return p, p.stdout   def
source_path(*names):@@ -2200,8 +2201,9 @@ def check_dbus(target_config,
verbose):     if verbose:         sys.stdout.write(cmd + "\n") -    sout =
get_command_output(cmd)+    p, sout = get_command_output(cmd)     iflags =
sout.read().strip()+    p.wait()      if not iflags:         inform("DBus v1
does not seem to be installed.")
Regards,



-----
Mickaƫl Schoentgen. 
[FR] Personal blog: http://www.tiger-222.fr 
--
Sent from: http://python.6.x6.nabble.com/PyQt-f1792048.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181217/d642204e/attachment.html>


More information about the PyQt mailing list