[ovirt-devel] F20 python 2.7.5-12 breaks cpopen

Dan Kenigsberg danken at redhat.com
Mon Jun 23 11:20:44 UTC 2014


It's a bit confusing, but this is not a task for infra at ovirt, but for
the the similarly-named but utterly different team of ovirt developers,
who prefer patches to be sent as pull requests to
https://github.com/ovirt-infra/cpopen


On Mon, Jun 23, 2014 at 05:19:01AM -0400, Francesco Romani wrote:
> The attached patch fixes locally.
> 
> 
> ----- Original Message -----
> > From: "Francesco Romani" <fromani at redhat.com>
> > To: "infra" <infra at ovirt.org>
> > Sent: Monday, June 23, 2014 10:48:23 AM
> > Subject: F20 python 2.7.5-12 breaks cpopen
> > 
> > Hi Infra,
> > 
> > I just discovered the hard way that the last python package in F20
> > 
> > # rpm -qi python
> > Name        : python
> > Version     : 2.7.5
> > Release     : 12.fc20
> > Architecture: x86_64
> > Install Date: Mon 23 Jun 2014 08:28:32 AM CEST
> > Group       : Development/Languages
> > Size        : 80819
> > License     : Python
> > Signature   : RSA/SHA256, Thu 19 Jun 2014 04:49:28 PM CEST, Key ID
> > 2eb161fa246110c1
> > Source RPM  : python-2.7.5-12.fc20.src.rpm
> > Build Date  : Thu 19 Jun 2014 02:54:35 PM CEST
> > Build Host  : buildvm-24.phx2.fedoraproject.org
> > Relocations : (not relocatable)
> > Packager    : Fedora Project
> > Vendor      : Fedora Project
> > URL         : http://www.python.org/
> > Summary     : An interpreted, interactive, object-oriented programming
> > language
> > 
> > [...]
> > 
> > Includes this apparently innocuous change:
> > * Thu Jun 19 2014 Bohuslav Kabrda <bkabrda at redhat.com> - 2.7.5-12
> > - Fix test failures with SQLite 3.8.4
> > - Fix double close of subprocess pipes when child process fails Resolves:
> > rhbz#1103450 <<< THIS ONE!
> > 
> > Which is
> > http://hg.python.org/cpython/rev/43749cb6bdbd
> > 
> > If we try to run VDSM tests using cpopen 1.3-2[1]
> > 
> > we'll get: http://fpaste.org/112115/
> > 
> > the fix is simple: just use execute_child_v276 and everything will work
> > again.
> > How can we detect and react properly to this schenario, however?
> > 
> > Thanks,
> > 
> > +++
> > 
> > [1]
> > # rpm -qi python-cpopen
> > Name        : python-cpopen
> > Version     : 1.3
> > Release     : 2.fc20
> > Architecture: x86_64
> > Install Date: Sat 15 Feb 2014 09:50:01 PM CET
> > 
> > 
> > --
> > Francesco Romani
> > RedHat Engineering Virtualization R & D
> > Phone: 8261328
> > IRC: fromani
> > _______________________________________________
> > Infra mailing list
> > Infra at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/infra
> > 
> 
> -- 
> Francesco Romani
> RedHat Engineering Virtualization R & D
> Phone: 8261328
> IRC: fromani

> From a5895505d051dfe387c573474e71b3faf696fcf0 Mon Sep 17 00:00:00 2001
> From: Francesco Romani <fromani at redhat.com>
> Date: Mon, 23 Jun 2014 11:17:47 +0200
> Subject: [PATCH] compatibility with F20's python 2.7.5-12


I'd prefer the commit message to state the exact exception seen, so that
other user could find the fixing patch more easily.

> 
> ---
>  cpopen/__init__.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/cpopen/__init__.py b/cpopen/__init__.py
> index 46ed446..cea001e 100644
> --- a/cpopen/__init__.py
> +++ b/cpopen/__init__.py
> @@ -26,6 +26,7 @@ This is a simpler method of execing that doesn't go back to python after
>  forking. This allows for faster safer exec.
>  """
>  
> +import inspect
>  import os
>  import sys
>  from subprocess import Popen, PIPE
> @@ -101,5 +102,7 @@ class CPopen(Popen):
>  
>      if sys.version_info[0:3] >= (2, 7, 6):
>          _execute_child = _execute_child_v276
> +    elif 'to_close' in inspect.getargspec(Popen._execute_child).args:
> +        _execute_child = _execute_child_v276
>      else:
>          _execute_child = _execute_child_v275
> -- 
> 1.9.3
> 

> _______________________________________________
> Infra mailing list
> Infra at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/infra




More information about the Devel mailing list