Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subprocess test cases fail with noexec-mounted /tmp #42989

Closed
calvin mannequin opened this issue Mar 6, 2006 · 3 comments
Closed

subprocess test cases fail with noexec-mounted /tmp #42989

calvin mannequin opened this issue Mar 6, 2006 · 3 comments
Labels
stdlib Python modules in the Lib dir

Comments

@calvin
Copy link
Mannequin

calvin mannequin commented Mar 6, 2006

BPO 1444408
Files
  • python-subprocess-test.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2006-07-10.20:30:20.000>
    created_at = <Date 2006-03-06.20:48:29.000>
    labels = ['library']
    title = 'subprocess test cases fail with noexec-mounted /tmp'
    updated_at = <Date 2006-07-10.20:30:20.000>
    user = 'https://bugs.python.org/calvin'

    bugs.python.org fields:

    activity = <Date 2006-07-10.20:30:20.000>
    actor = 'astrand'
    assignee = 'astrand'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2006-03-06.20:48:29.000>
    creator = 'calvin'
    dependencies = []
    files = ['1914']
    hgrepos = []
    issue_num = 1444408
    keywords = []
    message_count = 3.0
    messages = ['27689', '27690', '27691']
    nosy_count = 2.0
    nosy_names = ['calvin', 'astrand']
    pr_nums = []
    priority = 'normal'
    resolution = 'wont fix'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1444408'
    versions = []

    @calvin
    Copy link
    Mannequin Author

    calvin mannequin commented Mar 6, 2006

    Hi,

    on my Linux box two subprocess tests always fail (see
    below for a log output).
    The reason is those two tests try to execute files
    created with tempfile.mkstemp(), which generates files
    in /tmp. And my /tmp directory forbids to execute
    files, it is mounted with the "noexec" option.

    What I expected from the tests is to either find a
    temporary directory where execution is allowed (eg. the
    directory where sys.executable lies), or simply skip
    those tests.

    Test output:
    [...]
    ======================================================================
    ERROR: test_args_string
    (test.test_subprocess.ProcessTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):                    
                
      File
    "/home/calvin/src/python-svn/Lib/test/test_subprocess.py",
    line 490, in test_args_string
        p = subprocess.Popen(fname)
      File "/home/calvin/src/python-svn/Lib/subprocess.py",
    line 580, in __init__
        errread, errwrite)
      File "/home/calvin/src/python-svn/Lib/subprocess.py",
    line 1033, in _execute_child
        raise child_exception
    OSError: [Errno 13] Permission denied

    ======================================================================
    ERROR: test_call_string
    (test.test_subprocess.ProcessTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File
    "/home/calvin/src/python-svn/Lib/test/test_subprocess.py",
    line 532, in test_call_string
        rc = subprocess.call(fname)
      File "/home/calvin/src/python-svn/Lib/subprocess.py",
    line 431, in call
        return Popen(*popenargs, **kwargs).wait()
      File "/home/calvin/src/python-svn/Lib/subprocess.py",
    line 580, in __init__
        errread, errwrite)
      File "/home/calvin/src/python-svn/Lib/subprocess.py",
    line 1033, in _execute_child
        raise child_exception
    OSError: [Errno 13] Permission denied

    @calvin calvin mannequin closed this as completed Mar 6, 2006
    @calvin calvin mannequin assigned astrand Mar 6, 2006
    @calvin calvin mannequin added the stdlib Python modules in the Lib dir label Mar 6, 2006
    @calvin calvin mannequin closed this as completed Mar 6, 2006
    @calvin calvin mannequin assigned astrand Mar 6, 2006
    @calvin calvin mannequin added the stdlib Python modules in the Lib dir label Mar 6, 2006
    @calvin
    Copy link
    Mannequin Author

    calvin mannequin commented Mar 16, 2006

    Logged In: YES
    user_id=9205

    I attached a patch that creates temp files in the directory
    of sys.executable. This directory is guaranteed to have
    executable permissions, and should also have write
    permissions (since sys.executable should have been generated
    from a previous make run).

    With the patch the test case runs ok.

    @astrand
    Copy link
    Mannequin

    astrand mannequin commented Jul 10, 2006

    Logged In: YES
    user_id=344921

    The directory with sys.executable is certainly not
    guaranteed to be writable. For example, when I run the test
    suite with the Python shipped with my Linux distribution,
    os.path.dirname(sys.executable) is /usr/bin, which I cannot
    write to. So, I don't like this patch.

    Having /tmp mounted with "noexec" is just stupid, IMHO.
    Which Linux distribution does this?

    I do have some experience with working around "noexec"
    mounts and my experience is that /tmp is "as good as it
    gets". If someone can prove me wrong, then we can think of
    patching test_subprocess, but until that, I'm going to close
    this bug.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants