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

test_httpservers on Debian Testing #49685

Closed
zamotcr mannequin opened this issue Mar 7, 2009 · 11 comments
Closed

test_httpservers on Debian Testing #49685

zamotcr mannequin opened this issue Mar 7, 2009 · 11 comments
Labels
stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@zamotcr
Copy link
Mannequin

zamotcr mannequin commented Mar 7, 2009

BPO 5435
Nosy @facundobatista, @humitos
Files
  • bug.txt: ./python Lib/test/regrtest.py -v test_httpservers > bug.txt
  • httpservers_test
  • unnamed
  • 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 2009-03-23.17:18:34.078>
    created_at = <Date 2009-03-07.05:37:16.769>
    labels = ['tests', 'type-bug', 'library', 'invalid']
    title = 'test_httpservers on Debian Testing'
    updated_at = <Date 2009-04-03.00:05:21.304>
    user = 'https://bugs.python.org/zamotcr'

    bugs.python.org fields:

    activity = <Date 2009-04-03.00:05:21.304>
    actor = 'zamotcr'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-03-23.17:18:34.078>
    closer = 'facundobatista'
    components = ['Library (Lib)', 'Tests']
    creation = <Date 2009-03-07.05:37:16.769>
    creator = 'zamotcr'
    dependencies = []
    files = ['13259', '13400', '13590']
    hgrepos = []
    issue_num = 5435
    keywords = []
    message_count = 11.0
    messages = ['83274', '83278', '83285', '83286', '83287', '83288', '84006', '84007', '84010', '84020', '85283']
    nosy_count = 4.0
    nosy_names = ['facundobatista', 'ocean-city', 'humitos', 'zamotcr']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue5435'
    versions = ['Python 3.0']

    @zamotcr
    Copy link
    Mannequin Author

    zamotcr mannequin commented Mar 7, 2009

    Hi, im trying to compile Python 3.0.1 under Debian Testing, and i get an
    error in the step make test.
    test_https fails with errno 13. The atach file has the full output.
    So, what is missing in my computer or what i need to do, to compile it,
    thanks and sorry for my english.

    @zamotcr zamotcr mannequin added the build The build process and cross-build label Mar 7, 2009
    @pitrou pitrou added stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error and removed build The build process and cross-build labels Mar 7, 2009
    @ocean-city
    Copy link
    Mannequin

    ocean-city mannequin commented Mar 7, 2009

    I tried on coLinux(debian) and I got similar errors. But I'm not unix
    guy, I don't know well what "permission denied" means.

    debian:~/python-dev/py3k# ./python Lib/test/test_httpservers.py
    test_command (main.BaseHTTPServerTestCase) ... ok
    test_handler (main.BaseHTTPServerTestCase) ... ok
    test_head_keep_alive (main.BaseHTTPServerTestCase) ... ok
    test_header_close (main.BaseHTTPServerTestCase) ... ok
    test_internal_key_error (main.BaseHTTPServerTestCase) ... ok
    test_request_line_trimming (main.BaseHTTPServerTestCase) ... ok
    test_return_custom_status (main.BaseHTTPServerTestCase) ... ok
    test_return_header_keep_alive (main.BaseHTTPServerTestCase) ... ok
    test_send_blank (main.BaseHTTPServerTestCase) ... ok
    test_version_bogus (main.BaseHTTPServerTestCase) ... ok
    test_version_digits (main.BaseHTTPServerTestCase) ... ok
    test_version_invalid (main.BaseHTTPServerTestCase) ... ok
    test_version_none (main.BaseHTTPServerTestCase) ... ok
    test_version_none_get (main.BaseHTTPServerTestCase) ... ok
    test_get (main.SimpleHTTPServerTestCase) ... FAIL
    test_head (main.SimpleHTTPServerTestCase) ... ok
    test_invalid_requests (main.SimpleHTTPServerTestCase) ... ok
    test_authorization (main.CGIHTTPServerTestCase) ... Traceback (most
    recent call last):
    File "/root/python-dev/py3k/Lib/http/server.py", line 1031, in run_cgi
    os.execve(scriptfile, args, os.environ)
    OSError: [Errno 13] Permission denied
    ERROR
    test_headers_and_content (main.CGIHTTPServerTestCase) ... Traceback
    (most recent call last):
    File "/root/python-dev/py3k/Lib/http/server.py", line 1031, in run_cgi
    os.execve(scriptfile, args, os.environ)
    OSError: [Errno 13] Permission denied
    ERROR
    test_invaliduri (main.CGIHTTPServerTestCase) ... ok
    test_post (main.CGIHTTPServerTestCase) ... Traceback (most recent
    call last):
    File "/root/python-dev/py3k/Lib/http/server.py", line 1031, in run_cgi
    os.execve(scriptfile, args, os.environ)
    OSError: [Errno 13] Permission denied
    FAIL

    ======================================================================
    ERROR: test_authorization (main.CGIHTTPServerTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "Lib/test/test_httpservers.py", line 342, in test_authorization
        (res.read(), res.getheader('Content-type'), res.status))
      File "/root/python-dev/py3k/Lib/http/client.py", line 592, in getheader
        return ', '.join(self.msg.get_all(name, default))
    TypeError

    ======================================================================
    ERROR: test_headers_and_content (main.CGIHTTPServerTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "Lib/test/test_httpservers.py", line 322, in test_headers_and_content
        (res.read(), res.getheader('Content-type'), res.status))
      File "/root/python-dev/py3k/Lib/http/client.py", line 592, in getheader
        return ', '.join(self.msg.get_all(name, default))
    TypeError

    ======================================================================
    FAIL: test_get (main.SimpleHTTPServerTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "Lib/test/test_httpservers.py", line 244, in test_get
        self.check_status_and_reason(response, 404)
      File "Lib/test/test_httpservers.py", line 220, in check_status_and_reason
        self.assertEquals(response.status, status)
    AssertionError: 200 != 404

    ======================================================================
    FAIL: test_post (main.CGIHTTPServerTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "Lib/test/test_httpservers.py", line 330, in test_post
        self.assertEquals(res.read(), b'1, python, 123456\n')
    AssertionError: b'' != b'1, python, 123456\n'

    @zamotcr
    Copy link
    Mannequin Author

    zamotcr mannequin commented Mar 7, 2009

    I tried too yesterday with the svn version, and i get the same error.
    Is there a solution or im doing something wrong?

    @ocean-city
    Copy link
    Mannequin

    ocean-city mannequin commented Mar 7, 2009

    Probably this is short code to reproduce "permission denied".

    import os, pwd
    nobody = pwd.getpwnam('nobody')[2]
    os.setuid(nobody)
    open("dummy.txt", "w").write("foo") # permission denied

    Still I cannot understand what's going on. Is debian more secure than
    other unixes?

    @zamotcr
    Copy link
    Mannequin Author

    zamotcr mannequin commented Mar 7, 2009

    I dont know, it weird, because im running the test as root. I tried in a
    Stable Lenny, and nothing too

    @zamotcr
    Copy link
    Mannequin Author

    zamotcr mannequin commented Mar 7, 2009

    I re-download again (maybe its the four time jaja) the python 3.0.1 from
    the svn and now, it pass all the tests. Thanks to all!

    @humitos
    Copy link
    Mannequin

    humitos mannequin commented Mar 23, 2009

    I downloaded py3k branch and ran the tests with a regular user. All test
    pass OK.

    SVN Revision: 70469

    @ocean-city
    Copy link
    Mannequin

    ocean-city mannequin commented Mar 23, 2009

    Hmm, I'm using coLinux with root user. (default)
    Maybe that's difference.

    @humitos
    Copy link
    Mannequin

    humitos mannequin commented Mar 23, 2009

    I think it isn't a problem / bug, rather than it's a protection method
    to don't execute this test or cgi stuff with root user.

    In the middle, it change a userid to 'nobody', then if you are logged in
    as root, it can change the userid and then you don't have permission to
    write in the disk; and if you are logged in with as a regular user it
    can't change the userid and works OK.

    @facundobatista
    Copy link
    Member

    CGI tests shouldn't be run as root, it seems, as it breaks the inherent
    protection.

    @zamotcr
    Copy link
    Mannequin Author

    zamotcr mannequin commented Apr 3, 2009

    yes it ran with normal user :-) thanks now im enjoying python 3k ;-)

    2009/3/23 Facundo Batista <report@bugs.python.org>

    Facundo Batista <facundo@taniquetil.com.ar> added the comment:

    CGI tests shouldn't be run as root, it seems, as it breaks the inherent
    protection.

    ----------
    nosy: +facundobatista
    resolution: -> invalid
    status: open -> closed


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue5435\>


    @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 tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants