Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-delegator.py for 
openSUSE:Factory checked in at 2022-10-25 11:19:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-delegator.py (Old)
 and      /work/SRC/openSUSE:Factory/.python-delegator.py.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-delegator.py"

Tue Oct 25 11:19:40 2022 rev:3 rq:1030872 version:0.1.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-delegator.py/python-delegator.py.changes  
2019-04-05 12:02:54.946575662 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-delegator.py.new.2275/python-delegator.py.changes
        2022-10-25 11:19:43.854099876 +0200
@@ -1,0 +2,5 @@
+Sun Oct 23 09:43:15 UTC 2022 - John Vandenberg <jay...@gmail.com>
+
+- Replace custom exclude-eof-from-result.patch with merged_pr_62.patch
+
+-------------------------------------------------------------------

Old:
----
  exclude-eof-from-result.patch

New:
----
  merged_pr_62.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-delegator.py.spec ++++++
--- /var/tmp/diff_new_pack.vWFGGK/_old  2022-10-25 11:19:44.326100922 +0200
+++ /var/tmp/diff_new_pack.vWFGGK/_new  2022-10-25 11:19:44.330100931 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-delegator.py
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -23,10 +23,10 @@
 Summary:        Python library for dealing with subprocesses
 License:        MIT
 Group:          Development/Languages/Python
-Url:            https://github.com/kennethreitz/delegator.py
+URL:            https://github.com/kennethreitz/delegator.py
 Source:         
https://files.pythonhosted.org/packages/source/d/delegator.py/delegator.py-%{version}.tar.gz
 Source1:        
https://raw.githubusercontent.com/kennethreitz/delegator.py/master/tests/test_chain.py
-Patch0:         exclude-eof-from-result.patch
+Patch0:         merged_pr_62.patch
 BuildRequires:  %{python_module pexpect >= 4.1.0}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}

++++++ merged_pr_62.patch ++++++
>From 9bb7790d6ad54a238f57cce8ad93a811ef302268 Mon Sep 17 00:00:00 2001
From: Dan Ryan <d...@danryan.co>
Date: Mon, 22 Oct 2018 09:42:40 -0400
Subject: [PATCH 1/3] Explicitly close file handles on block

- Fixes #61

Signed-off-by: Dan Ryan <d...@danryan.co>
---
 delegator.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/delegator.py b/delegator.py
index d15aeb9..9eb430d 100644
--- a/delegator.py
+++ b/delegator.py
@@ -233,6 +233,8 @@ def kill(self):
     def block(self):
         """Blocks until process is complete."""
         if self._uses_subprocess:
+            # Close open file handles to prevent leaking them
+            self.subprocess.stdout.close()
             # consume stdout and stderr
             try:
                 stdout, stderr = self.subprocess.communicate()
@@ -241,6 +243,8 @@ def block(self):
             except ValueError:
                 pass  # Don't read from finished subprocesses.
         else:
+            self.subprocess.sendeof()
+            self.subprocess.proc.stdout.close()
             self.subprocess.wait()
 
     def pipe(self, command, timeout=None, cwd=None):

>From eddd9d14e50f7945faf99cac92ef33ab18b1342b Mon Sep 17 00:00:00 2001
From: Dan Ryan <d...@danryan.co>
Date: Mon, 22 Oct 2018 10:04:15 -0400
Subject: [PATCH 2/3] Don't pass `subprocess.PIPE` to blocking Popen calls

Signed-off-by: Dan Ryan <d...@danryan.co>
---
 delegator.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/delegator.py b/delegator.py
index 9eb430d..3ffb2e3 100644
--- a/delegator.py
+++ b/delegator.py
@@ -178,6 +178,7 @@ def run(self, block=True, binary=False, cwd=None, env=None):
         # Use subprocess.
         if self.blocking:
             popen_kwargs = self._default_popen_kwargs.copy()
+            del popen_kwargs["stdin"]
             popen_kwargs["universal_newlines"] = not binary
             if cwd:
                 popen_kwargs["cwd"] = cwd
@@ -233,19 +234,23 @@ def kill(self):
     def block(self):
         """Blocks until process is complete."""
         if self._uses_subprocess:
-            # Close open file handles to prevent leaking them
-            self.subprocess.stdout.close()
             # consume stdout and stderr
-            try:
-                stdout, stderr = self.subprocess.communicate()
-                self.__out = stdout
-                self.__err = stderr
-            except ValueError:
-                pass  # Don't read from finished subprocesses.
+            if self.blocking:
+                try:
+                    stdout, stderr = self.subprocess.communicate()
+                    self.__out = stdout
+                    self.__err = stderr
+                except ValueError:
+                    pass  # Don't read from finished subprocesses.
+            else:
+                self.subprocess.stdin.close()
+                self.std_out.close()
+                self.std_err.close()
+                self.subprocess.wait()
         else:
             self.subprocess.sendeof()
-            self.subprocess.proc.stdout.close()
             self.subprocess.wait()
+            self.subprocess.proc.stdout.close()
 
     def pipe(self, command, timeout=None, cwd=None):
         """Runs the current command and passes its output to the next

>From d07d065ef3ae5f7b637214a9fe193a4c642126cb Mon Sep 17 00:00:00 2001
From: Dan Ryan <d...@danryan.co>
Date: Tue, 23 Oct 2018 18:53:27 -0400
Subject: [PATCH 3/3] Don't pass `EOF` to the caller

Signed-off-by: Dan Ryan <d...@danryan.co>
---
 delegator.py | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/delegator.py b/delegator.py
index 3ffb2e3..56d1245 100644
--- a/delegator.py
+++ b/delegator.py
@@ -7,6 +7,8 @@
 import errno
 
 from pexpect.popen_spawn import PopenSpawn
+import pexpect
+pexpect.EOF.__module__ = "pexpect.exceptions"
 
 # Include `unicode` in STR_TYPES for Python 2.X
 try:
@@ -110,7 +112,7 @@ def _pexpect_out(self):
         if self.subprocess.before:
             result += self.subprocess.before
 
-        if self.subprocess.after:
+        if self.subprocess.after and self.subprocess.after is not pexpect.EOF:
             result += self.subprocess.after
 
         result += self.subprocess.read()
@@ -206,7 +208,10 @@ def expect(self, pattern, timeout=-1):
         if self.blocking:
             raise RuntimeError("expect can only be used on non-blocking 
commands.")
 
-        self.subprocess.expect(pattern=pattern, timeout=timeout)
+        try:
+            self.subprocess.expect(pattern=pattern, timeout=timeout)
+        except pexpect.EOF:
+            pass
 
     def send(self, s, end=os.linesep, signal=False):
         """Sends the given string or signal to std_in."""
@@ -249,8 +254,11 @@ def block(self):
                 self.subprocess.wait()
         else:
             self.subprocess.sendeof()
-            self.subprocess.wait()
-            self.subprocess.proc.stdout.close()
+            try:
+                self.subprocess.wait()
+            finally:
+                if self.subprocess.proc.stdout:
+                    self.subprocess.proc.stdout.close()
 
     def pipe(self, command, timeout=None, cwd=None):
         """Runs the current command and passes its output to the next
@@ -272,7 +280,6 @@ def pipe(self, command, timeout=None, cwd=None):
         c.run(block=False, cwd=cwd)
         if data:
             c.send(data)
-            c.subprocess.sendeof()
         c.block()
         return c
 

Reply via email to