Bug 1040210 - cpopen: _execute_child needs a 'to_close' parameter with Python 2.7.6
Summary: cpopen: _execute_child needs a 'to_close' parameter with Python 2.7.6
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: vdsm
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.4.0
Assignee: Saggi Mizrahi
QA Contact: Haim
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-10 23:41 UTC by Ondřej Svoboda
Modified: 2014-01-12 22:37 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-12 22:37:53 UTC
oVirt Team: ---


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.