You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Jonathan Barber (JIRA)" <ji...@apache.org> on 2013/04/23 12:37:15 UTC

[jira] [Updated] (HADOOP-9493) Replace popen2 module with subprocess in HOD to eliminate deprecation warning

     [ https://issues.apache.org/jira/browse/HADOOP-9493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Barber updated HADOOP-9493:
------------------------------------

    Attachment: HADOOP-9493.patch

Patch to replace popen2 module with subprocess.

Tested against Python 2.6.6 (RHEL's version) and Python 2.5.6 (compiled from python.org source) with the "allocate", "deallocate", "info" and "list" commands on a Torque cluster.

The subprocess module was introduced in Python 2.4, so this change will break older versions of Python. However, the latest release of Python 2.3 is from March 2008, so I think it's okay to break it.
                
> Replace popen2 module with subprocess in HOD to eliminate deprecation warning
> -----------------------------------------------------------------------------
>
>                 Key: HADOOP-9493
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9493
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: contrib/hod
>    Affects Versions: 1.1.2
>         Environment: RHEL6.4 and Python 2.6.6
>            Reporter: Jonathan Barber
>            Priority: Minor
>             Fix For: 1.1.2
>
>         Attachments: HADOOP-9493.patch
>
>
> Python 2.6.6 issues the following warning when running the "hod" command:
> """
> /homes/jbarber/hadoop-1.1.2/contrib/hod/hodlib/Common/threads.py:19: DeprecationWarning: The popen2 module is deprecated.  Use the subprocess module.
>   from popen2 import Popen4, Popen3, MAXFD
> """
> The popen2 module was deprecated in Python 2.6.
> The attached patch replaces the usage of popen2 with the subprocess module.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira