Commit Graph

60 Commits

Author SHA1 Message Date
Benjamin Peterson a50f89954d merge 3.2 (#19435) 2013-10-30 12:50:18 -04:00
Benjamin Peterson 35aca89617 merge 3.1 (#19435) 2013-10-30 12:48:59 -04:00
Benjamin Peterson 04e9de40f3 use the collapsed path in the run_cgi method (closes #19435) 2013-10-30 12:43:09 -04:00
Senthil Kumaran 72c238e21a Fix http.server's request handling case on trailing '/'.
Patch contributed by Vajrasky Kok. Addresses Issue #17324
2013-09-13 00:21:18 -07:00
Serhiy Storchaka 8b27f23e02 Do not raise self.skipTest().
skipTest() already raises an exception.
2013-02-04 15:45:58 +02:00
Serhiy Storchaka 0b4591e0eb Do not raise self.skipTest().
skipTest() already raises an exception.
2013-02-04 15:45:00 +02:00
Antoine Pitrou 2a180207ba Speed up test_httpservers by avoiding a one-second cleanup wait after each test case. 2012-09-30 01:08:55 +02:00
Antoine Pitrou f727082b71 Speed up test_httpservers by avoiding a one-second cleanup wait after each test case. 2012-09-30 01:05:30 +02:00
Antoine Pitrou 4adc9a8cc9 Fix CGI tests to take into account the platform's line ending (issue #13119) 2012-08-05 14:53:33 +02:00
Antoine Pitrou e768c39890 Fix CGI tests to take into account the platform's line ending (issue #13119) 2012-08-05 14:52:45 +02:00
Senthil Kumaran 690598aba2 merge to default - Issue 10484 - Incorporate improvements to CGI module - Suggested by Glenn Linderman. Refactor code and tests 2012-04-12 02:37:11 +08:00
Senthil Kumaran d70846b1b1 3.2 - Issue 10484 - Incorporate improvements to CGI module - Suggested by Glenn Linderman. Refactor code and tests 2012-04-12 02:34:32 +08:00
Senthil Kumaran d05853da97 merge - fix the incorrect changes made for PATH_INFO value - Issue10484 2012-04-11 03:16:16 +08:00
Senthil Kumaran dbb369d0ef 3.2- fix the incorrect changes made for PATH_INFO value - Issue10484 2012-04-11 03:15:28 +08:00
Senthil Kumaran 209d70e579 closes issue10484 - Fix the http.server's cgi PATH_INFO handling problem 2012-03-16 01:14:51 -07:00
Senthil Kumaran be3f851411 closes issue10484 - Fix the http.server's cgi PATH_INFO handling problem 2012-03-16 01:13:50 -07:00
Charles-François Natali b2cca00c14 Issue #13308: Fix test_httpservers failures when run as root. 2011-11-02 19:36:02 +01:00
Charles-François Natali f7ed9fc063 Issue #13308: Fix test_httpservers failures when run as root. 2011-11-02 19:35:14 +01:00
Senthil Kumaran c7ae19b6a7 Issue #3709: a flush_headers method to BaseHTTPRequestHandler which manages the
sending of headers to output stream and flushing the internal headers buffer.
Patch contribution by Andrew Schaaf
2011-05-09 23:25:02 +08:00
Antoine Pitrou cb342182ee Try to strengthen test_httpservers (issue #11617) 2011-03-21 00:26:51 +01:00
Ezio Melotti 3b3499ba69 #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
Ezio Melotti 13925008dc #11565: Fix several typos. Patch by Piotr Kasprzyk. 2011-03-16 11:05:33 +02:00
Armin Ronacher 59531287fd To match the behaviour of HTTP server, the HTTP client library now also encodes
headers with iso-8859-1 (latin1) encoding.  It was already doing that for
incoming headers which makes this behaviour now consistent in both incoming and
outgoing direction.
2011-01-22 13:44:22 +00:00
Armin Ronacher 8d96d77f9a Issue #10980: encode headers with latin1 instead of ASCII in the HTTP server.
This makes the implementation of PEP 3333 compliant servers on top of
BaseHTTPServer possible.
2011-01-22 13:13:05 +00:00
Brian Curtin 3b4499c5c7 Fix #9333. The symlink function is always available now, raising OSError
when the user doesn't hold the symbolic link privilege rather than hiding it.
2010-12-28 14:31:47 +00:00
Antoine Pitrou ff1bbba92a Merged revisions 87373,87381 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87373 | senthil.kumaran | 2010-12-18 17:55:23 +0100 (sam., 18 déc. 2010) | 3 lines

  Fix Issue6791 - Limit the HTTP header readline with _MAXLENGTH. Patch by Antoine Pitrou
........
  r87381 | antoine.pitrou | 2010-12-18 18:59:18 +0100 (sam., 18 déc. 2010) | 3 lines

  NEWS entry for r87373
........
2010-12-18 18:04:38 +00:00
Senthil Kumaran 5466bf1c94 Fix Issue6791 - Limit the HTTP header readline with _MAXLENGTH. Patch by Antoine Pitrou 2010-12-18 16:55:23 +00:00
Antoine Pitrou db848f1276 svnmerge fooled me. That test class already existed. 2010-12-16 17:17:40 +00:00
Antoine Pitrou c5e548f6a5 Forgot to enable this test 2010-12-16 17:05:26 +00:00
Antoine Pitrou 3022ce1a14 Merged revisions 87317 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87317 | antoine.pitrou | 2010-12-16 17:48:36 +0100 (jeu., 16 déc. 2010) | 4 lines

  Issue #10714: Limit length of incoming request in http.server to 65536 bytes
  for security reasons.  Initial patch by Ross Lagerwall.
........

(also backport some tests)
2010-12-16 17:03:16 +00:00
Antoine Pitrou c492437922 Issue #10714: Limit length of incoming request in http.server to 65536 bytes
for security reasons.  Initial patch by Ross Lagerwall.
2010-12-16 16:48:36 +00:00
Brian Curtin 52173d4959 Fix #9333. Expose os.symlink on Windows only when usable.
In order to create symlinks on Windows, SeCreateSymbolicLinkPrivilege
is an account privilege that is required to be held by the user. Not only
must the privilege be enabled for the account, the activated privileges for
the currently running application must be adjusted to enable the requested
privilege.

Rather than exposing an additional function to be called prior to the user's
first os.symlink call, we handle the AdjustTokenPrivileges Windows API call
internally and only expose os.symlink when the privilege escalation was
successful.

Due to the change of only exposing os.symlink when it's available, we can
go back to the original test skipping methods of checking via `hasattr`.
2010-12-02 18:29:18 +00:00
Senthil Kumaran e4dad4f8e2 Fix issue3709 - BaseHTTPRequestHandler will buffer the headers and write only on end_headers call. 2010-11-21 14:36:14 +00:00
Ezio Melotti 19f2aeba67 Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line

  #9424: Replace deprecated assert* methods in the Python test suite.
........
2010-11-21 01:30:29 +00:00
Brian Curtin 61d0d60e13 Fix ResourceWarning for an unclosed socket.
test_return_header_keep_alive - Added a cleanup call for the socket.
2010-10-31 00:34:23 +00:00
Brett Cannon 105df5d75b Move test_httpservers over to file context managers. 2010-10-29 23:43:42 +00:00
Victor Stinner 6fb457526c test_httpservers: Python CGI scripts have to be encoded to utf-8
And not the locale encoding. With this commit, the test finally pass on Windows
with a non-ascii path :-)
2010-10-17 20:17:41 +00:00
Victor Stinner 3218c31429 test_httpservers: Fix skip test check, the python executable path have to be
encodable to utf-8, not to the file1 encoding.
2010-10-17 20:13:36 +00:00
Victor Stinner 0b0ca0c37e test_httpservers: skip CGI tests if Python executable path is not encodable 2010-10-17 19:46:36 +00:00
Senthil Kumaran 5e8826cd98 Merged revisions 85202 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85202 | senthil.kumaran | 2010-10-03 23:25:45 +0530 (Sun, 03 Oct 2010) | 4 lines

  Fix Issue9272 - Change CGIHTTPServer to give the child program a copy of os.environ
........
2010-10-03 18:04:52 +00:00
Senthil Kumaran 4271372a71 Fix Issue9272 - Change CGIHTTPServer to give the child program a copy of os.environ 2010-10-03 17:55:45 +00:00
Senthil Kumaran eb3b6ed7b0 Add BaseHTTPRequestHandler related tests. 2010-09-30 06:34:02 +00:00
Senthil Kumaran 0f476d49f8 Issue1491 - BaseHTTPServer incorrectly implements response code 100 2010-09-30 06:09:18 +00:00
Georg Brandl 6fcac0d6f6 Move test_SimpleHTTPServer into test_httpservers. 2010-08-02 18:56:54 +00:00
Brian Curtin d40e6f70a5 Implement #1578269. Patch by Jason R. Coombs.
Added Windows support for os.symlink when run on Windows 6.0 or greater,
aka Vista. Previous Windows versions will raise NotImplementedError
when trying to symlink.

Includes numerous test updates and additions to test_os, including
a symlink_support module because of the fact that privilege escalation
is required in order to run the tests to ensure that the user is able
to create symlinks. By default, accounts do not have the required
privilege, so the escalation code will have to be exposed later (or
documented on how to do so). I'll be following up with that work next.

Note that the tests use ctypes, which was agreed on during the PyCon
language summit.
2010-07-08 21:39:08 +00:00
Victor Stinner 45df820591 Merged revisions 80552-80556,80564-80566,80568-80571 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80552 | victor.stinner | 2010-04-27 23:46:03 +0200 (mar., 27 avril 2010) | 3 lines

  Issue #7449, part 1: fix test_support.py for Python compiled without thread
........
  r80553 | victor.stinner | 2010-04-27 23:47:01 +0200 (mar., 27 avril 2010) | 1 line

  Issue #7449, part 2: regrtest.py -j option requires thread support
........
  r80554 | victor.stinner | 2010-04-27 23:51:26 +0200 (mar., 27 avril 2010) | 9 lines

  Issue #7449 part 3, test_doctest: import trace module in test_coverage()

  Import trace module fail if the threading module is missing. test_coverage() is
  only used if test_doctest.py is used with the -c option. This commit allows to
  execute the test suite without thread support.

  Move "import trace" in test_coverage() and use
  test_support.import_module('trace').
........
  r80555 | victor.stinner | 2010-04-27 23:56:26 +0200 (mar., 27 avril 2010) | 6 lines

  Issue #7449, part 4: skip test_multiprocessing if thread support is disabled

  import threading after _multiprocessing to raise a more revelant error message:
  "No module named _multiprocessing". _multiprocessing is not compiled without
  thread support.
........
  r80556 | victor.stinner | 2010-04-28 00:01:24 +0200 (mer., 28 avril 2010) | 8 lines

  Issue #7449, part 5: split Test.test_open() of ctypes/test/test_errno.py

   * Split Test.test_open() in 2 functions: test_open() and test_thread_open()
   * Skip test_open() and test_thread_open() if we are unable to find the C
     library
   * Skip test_thread_open() if thread support is disabled
   * Use unittest.skipUnless(os.name == "nt", ...) on test_GetLastError()
........
  r80564 | victor.stinner | 2010-04-28 00:59:35 +0200 (mer., 28 avril 2010) | 4 lines

  Issue #7449, part 6: fix test_hashlib for missing threading module

  Move @test_support.reap_thread decorator from test_main() to test_threaded_hashing().
........
  r80565 | victor.stinner | 2010-04-28 01:01:29 +0200 (mer., 28 avril 2010) | 6 lines

  Issue #7449, part 7: simplify threading detection in test_capi

   * Skip TestPendingCalls if threading module is missing
   * Test if threading module is present or not, instead of test the presence of
     _testcapi._test_thread_state
........
  r80566 | victor.stinner | 2010-04-28 01:03:16 +0200 (mer., 28 avril 2010) | 4 lines

  Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing

  TestFifo can be executed without the threading module
........
  r80568 | victor.stinner | 2010-04-28 01:14:58 +0200 (mer., 28 avril 2010) | 6 lines

  Issue #7449, part 9: fix test_xmlrpclib for missing threading module

   * Skip testcases using threads if threading module is missing
   * Use "http://" instead of URL in ServerProxyTestCase if threading is missing
     because URL is not set in this case
........
  r80569 | victor.stinner | 2010-04-28 01:33:58 +0200 (mer., 28 avril 2010) | 6 lines

  Partial revert of r80556 (Issue #7449, part 5, fix ctypes test)

  Rewrite r80556: the thread test have to be executed just after the test on
  libc_open() and so the test cannot be splitted in two functions (without
  duplicating code, and I don't want to duplicate code).
........
  r80570 | victor.stinner | 2010-04-28 01:51:16 +0200 (mer., 28 avril 2010) | 8 lines

  Issue #7449, part 10: test_cmd imports trace module using test_support.import_module()

  Use test_support.import_module() instead of import to raise a SkipTest
  exception if the import fail. Import trace fails if the threading module is
  missing.

  See also part 3: test_doctest: import trace module in test_coverage().
........
  r80571 | victor.stinner | 2010-04-28 01:55:59 +0200 (mer., 28 avril 2010) | 6 lines

  Issue #7449, last part (11): fix many tests if thread support is disabled

   * Use try/except ImportError or test_support.import_module() to import thread
     and threading modules
   * Add @unittest.skipUnless(threading, ...) to testcases using threads
........
2010-04-28 22:31:17 +00:00
Antoine Pitrou e312391529 Merged revisions 80487,80489 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r80487 | antoine.pitrou | 2010-04-26 00:01:43 +0200 (lun., 26 avril 2010) | 12 lines

  Merged revisions 80484 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r80484 | antoine.pitrou | 2010-04-25 23:40:32 +0200 (dim., 25 avril 2010) | 6 lines

    Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown,
    where the method could block indefinitely if called just before the
    event loop started running.  This also fixes the occasional freezes
    witnessed in test_httpservers.
  ........
................
  r80489 | antoine.pitrou | 2010-04-26 00:19:43 +0200 (lun., 26 avril 2010) | 9 lines

  Merged revisions 80480 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r80480 | antoine.pitrou | 2010-04-25 23:15:50 +0200 (dim., 25 avril 2010) | 3 lines

    Replace a Lock with a better suited Event.
  ........
................
2010-04-25 22:26:08 +00:00
Antoine Pitrou 08911bd33e Merged revisions 80480 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80480 | antoine.pitrou | 2010-04-25 23:15:50 +0200 (dim., 25 avril 2010) | 3 lines

  Replace a Lock with a better suited Event.
........
2010-04-25 22:19:43 +00:00
Florent Xicluna 9b0e9180e2 Note: only the relevant parts of r79474 are merged.
Merged revisions 78793,78798-78799,78977,79095,79196,79474 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r78793 | florent.xicluna | 2010-03-08 13:25:35 +0100 (lun, 08 mar 2010) | 2 lines

  Fix macpath to deal with bytes
................
  r78798 | florent.xicluna | 2010-03-08 14:32:17 +0100 (lun, 08 mar 2010) | 18 lines

  Merged revisions 78777,78787,78790 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r78777 | florent.xicluna | 2010-03-08 00:49:03 +0100 (lun, 08 mar 2010) | 4 lines

    Backport the Popen.poll() protection from subprocess to multiprocessing. See #1731717.
    It should fix transient failures on test_multiprocessing.
  ........
    r78787 | florent.xicluna | 2010-03-08 08:21:16 +0100 (lun, 08 mar 2010) | 2 lines

    Don't fail on a debug() statement, if the worker PID is (still) None.
  ........
    r78790 | florent.xicluna | 2010-03-08 12:01:39 +0100 (lun, 08 mar 2010) | 2 lines

    On finalize, don't try to join not started process.
  ........
................
  r78799 | florent.xicluna | 2010-03-08 15:44:41 +0100 (lun, 08 mar 2010) | 2 lines

  Fix ntpath abspath to deal with bytes.
................
  r78977 | florent.xicluna | 2010-03-15 14:14:39 +0100 (lun, 15 mar 2010) | 2 lines

  Fix \xhh specs, #1889.  (an oversight of r60193, r60210).
................
  r79095 | florent.xicluna | 2010-03-19 15:40:31 +0100 (ven, 19 mar 2010) | 2 lines

  Rename test.test_support to test.support for 3.x.
................
  r79196 | florent.xicluna | 2010-03-21 13:29:50 +0100 (dim, 21 mar 2010) | 9 lines

  Merged revisions 79195 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r79195 | florent.xicluna | 2010-03-21 13:27:20 +0100 (dim, 21 mar 2010) | 2 lines

    Issue #8179: Fix macpath.realpath() on a non-existing path.
  ........
................
  r79474 | florent.xicluna | 2010-03-28 01:25:02 +0100 (dim, 28 mar 2010) | 33 lines

  Merged revisions 79297,79310,79382,79425-79427,79450 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r79297 | florent.xicluna | 2010-03-22 18:18:18 +0100 (lun, 22 mar 2010) | 2 lines

    #7668: Fix test_httpservers failure when sys.executable contains non-ASCII bytes.
  ........
    r79310 | florent.xicluna | 2010-03-22 23:52:11 +0100 (lun, 22 mar 2010) | 2 lines

    Issue #8205: Remove the "Modules" directory from sys.path when Python is running from the build directory (POSIX only).
  ........
    r79382 | florent.xicluna | 2010-03-24 20:33:25 +0100 (mer, 24 mar 2010) | 2 lines

    Skip tests which depend on multiprocessing.sharedctypes, if _ctypes is not available.
  ........
    r79425 | florent.xicluna | 2010-03-25 21:32:07 +0100 (jeu, 25 mar 2010) | 2 lines

    Syntax cleanup `== None` -> `is None`
  ........
    r79426 | florent.xicluna | 2010-03-25 21:33:49 +0100 (jeu, 25 mar 2010) | 2 lines

    #8207: Fix test_pep277 on OS X
  ........
    r79427 | florent.xicluna | 2010-03-25 21:39:10 +0100 (jeu, 25 mar 2010) | 2 lines

    Fix test_unittest and test_warnings when running "python -Werror -m test.regrtest"
  ........
    r79450 | florent.xicluna | 2010-03-26 20:32:44 +0100 (ven, 26 mar 2010) | 2 lines

    Ensure that the failed or unexpected tests are sorted before printing.
  ........
................
2010-03-28 11:42:38 +00:00
Florent Xicluna fd1b0930ce Merged revisions 79297,79310,79382,79425-79427,79450 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79297 | florent.xicluna | 2010-03-22 18:18:18 +0100 (lun, 22 mar 2010) | 2 lines

  #7668: Fix test_httpservers failure when sys.executable contains non-ASCII bytes.
........
  r79310 | florent.xicluna | 2010-03-22 23:52:11 +0100 (lun, 22 mar 2010) | 2 lines

  Issue #8205: Remove the "Modules" directory from sys.path when Python is running from the build directory (POSIX only).
........
  r79382 | florent.xicluna | 2010-03-24 20:33:25 +0100 (mer, 24 mar 2010) | 2 lines

  Skip tests which depend on multiprocessing.sharedctypes, if _ctypes is not available.
........
  r79425 | florent.xicluna | 2010-03-25 21:32:07 +0100 (jeu, 25 mar 2010) | 2 lines

  Syntax cleanup `== None` -> `is None`
........
  r79426 | florent.xicluna | 2010-03-25 21:33:49 +0100 (jeu, 25 mar 2010) | 2 lines

  #8207: Fix test_pep277 on OS X
........
  r79427 | florent.xicluna | 2010-03-25 21:39:10 +0100 (jeu, 25 mar 2010) | 2 lines

  Fix test_unittest and test_warnings when running "python -Werror -m test.regrtest"
........
  r79450 | florent.xicluna | 2010-03-26 20:32:44 +0100 (ven, 26 mar 2010) | 2 lines

  Ensure that the failed or unexpected tests are sorted before printing.
........
2010-03-28 00:25:02 +00:00