This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_httpservers on Debian Testing
Type: behavior Stage:
Components: Library (Lib), Tests Versions: Python 3.0
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: facundobatista, humitos, ocean-city, zamotcr
Priority: normal Keywords:

Created on 2009-03-07 05:37 by zamotcr, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bug.txt zamotcr, 2009-03-07 05:37 ./python Lib/test/regrtest.py -v test_httpservers > bug.txt
httpservers_test humitos, 2009-03-23 14:22
unnamed zamotcr, 2009-04-03 00:05
Messages (11)
msg83274 - (view) Author: Michael Zamot (zamotcr) Date: 2009-03-07 05:37
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.
msg83278 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-03-07 12:09
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'
msg83285 - (view) Author: Michael Zamot (zamotcr) Date: 2009-03-07 18:11
I tried too yesterday with the svn version, and i get the same error. 
Is there a solution or im doing something wrong?
msg83286 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-03-07 18:20
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?
msg83287 - (view) Author: Michael Zamot (zamotcr) Date: 2009-03-07 18:24
I dont know, it weird, because im running the test as root. I tried in a
Stable Lenny, and nothing too
msg83288 - (view) Author: Michael Zamot (zamotcr) Date: 2009-03-07 19:15
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!
msg84006 - (view) Author: Manuel Kaufmann (humitos) * Date: 2009-03-23 14:22
I downloaded py3k branch and ran the tests with a regular user. All test
pass OK.

SVN Revision: 70469
msg84007 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-03-23 14:25
Hmm, I'm using coLinux with root user. (default)
Maybe that's difference.
msg84010 - (view) Author: Manuel Kaufmann (humitos) * Date: 2009-03-23 15:32
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.
msg84020 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2009-03-23 17:18
CGI tests shouldn't be run as root, it seems, as it breaks the inherent
protection.
msg85283 - (view) Author: Michael Zamot (zamotcr) Date: 2009-04-03 00:05
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>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:56:46adminsetgithub: 49685
2012-03-27 01:20:00r.david.murraylinkissue4528 superseder
2009-04-03 00:05:21zamotcrsetfiles: + unnamed

messages: + msg85283
2009-03-23 17:18:34facundobatistasetstatus: open -> closed

nosy: + facundobatista
messages: + msg84020

resolution: not a bug
2009-03-23 15:32:17humitossetmessages: + msg84010
2009-03-23 14:25:43ocean-citysetmessages: + msg84007
2009-03-23 14:22:16humitossetfiles: + httpservers_test
nosy: + humitos
messages: + msg84006

2009-03-07 19:15:45zamotcrsetmessages: + msg83288
2009-03-07 18:24:06zamotcrsetmessages: + msg83287
2009-03-07 18:20:41ocean-citysetmessages: + msg83286
2009-03-07 18:11:49zamotcrsetmessages: + msg83285
2009-03-07 12:09:19ocean-citysetnosy: + ocean-city
messages: + msg83278
2009-03-07 10:17:42pitrousettype: compile error -> behavior
components: + Library (Lib), Tests, - None
2009-03-07 05:37:17zamotcrcreate