[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Fix ResourceWarnings in configure.py of PyQt
From:       Tiger-222 <contact () tiger-222 ! fr>
Date:       2018-12-17 15:31:30
Message-ID: 1545060690880-0.post () n6 ! nabble ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


A better patch to also fix:
The Python dbus module doesn't seem to be installed.configure.py:3028:
ResourceWarning: unclosed file <_io.BufferedReader name=7> 
check_dbus(target_config, opts.verbose)
--- configure.py	2018-12-17 16:28:17.153002003 +0100+++ configure-patched.py
2018-12-17 16:28:08.432824380 +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,10 @@ 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()+    sout.close()+    p.wait()      if not iflags:        
inform("DBus v1 does not seem to be installed.")




-----
Mickaël Schoentgen. 
[FR] Personal blog: http://www.tiger-222.fr 
--
Sent from: http://python.6.x6.nabble.com/PyQt-f1792048.html
[Attachment #5 (text/html)]

A better patch to also fix:
<pre>
The Python dbus module doesn't seem to be installed.
configure.py:3028: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  check_dbus(target_config, opts.verbose)
</pre>
<pre>
--- configure.py	2018-12-17 16:28:17.153002003 +0100
+++ configure-patched.py	2018-12-17 16:28:08.432824380 +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,10 @@ 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()
+    sout.close()
+    p.wait()
 
     if not iflags:
         inform("DBus v1 does not seem to be installed.")

</pre>

	
	
	<div class="signature" style="margin-top:1em;color:#666666;font-size:11px;">
				Mickaël Schoentgen.<br/>
[FR] Personal blog: <a href="http://www.tiger-222.fr" target="_top" rel="nofollow" \
link="external">http://www.tiger-222.fr</a>  </div>
<br/><hr align="left" width="300" />
Sent from the <a href="http://python.6.x6.nabble.com/PyQt-f1792048.html">PyQt mailing \
list archive</a> at Nabble.com.<br/>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic