Bug 1040210

Summary: cpopen: _execute_child needs a 'to_close' parameter with Python 2.7.6
Product: [Retired] oVirt Reporter: Ondřej Svoboda <ondrej>
Component: vdsmAssignee: Saggi Mizrahi <smizrahi>
Status: CLOSED NEXTRELEASE QA Contact: Haim <hateya>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: abaron, acathrow, bazulay, danken, iheim, mgoldboi, ybronhei, yeylon
Target Milestone: ---   
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-12 22:37:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ondřej Svoboda 2013-12-10 23:41:16 UTC
VDSM unit test 'test_getDevicePartedInfo' fails with Python 2.7.6 with the following traceback:

  File "/home/Data/src/vdsm/src/vdsm/tests/testValidation.py", line 99, in wrapper
    return f(*args, **kwargs)
  File "/home/Data/src/vdsm/src/vdsm/tests/parted_utils_tests.py", line 57, in setUp
    rc, out, err = utils.execCmd(cmd)
  File "/home/Data/src/vdsm/src/vdsm/lib/vdsm/utils.py", line 537, in execCmd
    deathSignal=deathSignal)
  File "/usr/lib/python2.7/site-packages/cpopen/__init__.py", line 48, in __init__
    stderr=PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 732, in __init__
    errread, errwrite)
TypeError: _execute_child() takes exactly 17 arguments (18 given)

This is due to python-cpopen replacing subprocess.Popen's internal method _execute_child which gained a new parameter 'to_close' in Python 2.7.6 (released on November 10, 2013), see http://hg.python.org/cpython/rev/43749cb6bdbd

Adding the 'to_close' parameter after 'shell' in cpopen's __init__.py fixes the test with Python 2.7.6. Hopefully cpopen's implementation doesn't suffer from the bug that inspired adding the parameter.

I guess that with cpopen not being updated often it is sufficient to release a new version sometime, adding the new parameter and requiring Python 2.7.6.

Should I file a bug at https://github.com/ficoos/cpopen too?

Comment 1 Dan Kenigsberg 2013-12-11 11:02:16 UTC
> Should I file a bug at https://github.com/ficoos/cpopen too?

You'd better file a pull-request ;-)

Comment 2 Itamar Heim 2014-01-12 08:41:53 UTC
setting target release to current version for consideration and review. please do not push non-RFE bugs to an undefined target release to make sure bugs are reviewed for relevancy, fix, closure, etc.

Comment 3 Dan Kenigsberg 2014-01-12 22:37:53 UTC
It's not a Vdsm bug, but one of cpopen. And it's solved (by Ondrej's patch) in cpopen-1.3.