diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/SimpleXMLRPCServer.py | 6 | ||||
-rw-r--r-- | Lib/distutils/command/__init__.py | 2 | ||||
-rw-r--r-- | Lib/glob.py | 2 | ||||
-rw-r--r-- | Lib/optparse.py | 1 | ||||
-rwxr-xr-x | Lib/pdb.py | 9 | ||||
-rw-r--r-- | Lib/test/test_sys.py | 5 | ||||
-rw-r--r-- | Lib/test/test_xmlrpc.py | 6 |
7 files changed, 28 insertions, 3 deletions
diff --git a/Lib/SimpleXMLRPCServer.py b/Lib/SimpleXMLRPCServer.py index 43757a0..b304e45 100644 --- a/Lib/SimpleXMLRPCServer.py +++ b/Lib/SimpleXMLRPCServer.py @@ -598,8 +598,12 @@ class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): self.handle_get() else: # POST data is normally available through stdin + try: + length = int(os.environ.get('CONTENT_LENGTH', None)) + except (TypeError, ValueError): + length = -1 if request_text is None: - request_text = sys.stdin.read() + request_text = sys.stdin.read(length) self.handle_xmlrpc(request_text) diff --git a/Lib/distutils/command/__init__.py b/Lib/distutils/command/__init__.py index 0888c27..05c758a 100644 --- a/Lib/distutils/command/__init__.py +++ b/Lib/distutils/command/__init__.py @@ -24,6 +24,8 @@ __all__ = ['build', 'bdist_dumb', 'bdist_rpm', 'bdist_wininst', + 'upload', + # These two are reserved for future use: #'bdist_sdux', #'bdist_pkgtool', diff --git a/Lib/glob.py b/Lib/glob.py index 75d7bf9..04364be 100644 --- a/Lib/glob.py +++ b/Lib/glob.py @@ -16,7 +16,7 @@ def glob(pathname): return list(iglob(pathname)) def iglob(pathname): - """Return a list of paths matching a pathname pattern. + """Return an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. diff --git a/Lib/optparse.py b/Lib/optparse.py index 02f62e4..56b05d6 100644 --- a/Lib/optparse.py +++ b/Lib/optparse.py @@ -11,6 +11,7 @@ For support, use the optik-users@lists.sourceforge.net mailing list __version__ = "1.5.3" __all__ = ['Option', + 'make_option', 'SUPPRESS_HELP', 'SUPPRESS_USAGE', 'Values', @@ -194,6 +194,12 @@ class Pdb(bdb.Bdb, cmd.Cmd): self.cmdloop() self.forget() + def displayhook(self, obj): + """Custom displayhook for the exec in default(), which prevents + assignment of the _ variable in the builtins. + """ + print repr(obj) + def default(self, line): if line[:1] == '!': line = line[1:] locals = self.curframe.f_locals @@ -202,13 +208,16 @@ class Pdb(bdb.Bdb, cmd.Cmd): code = compile(line + '\n', '<stdin>', 'single') save_stdout = sys.stdout save_stdin = sys.stdin + save_displayhook = sys.displayhook try: sys.stdin = self.stdin sys.stdout = self.stdout + sys.displayhook = self.displayhook exec code in globals, locals finally: sys.stdout = save_stdout sys.stdin = save_stdin + sys.displayhook = save_displayhook except: t, v = sys.exc_info()[:2] if type(t) == type(''): diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 35467e4..9589771 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -221,6 +221,11 @@ class SysModuleTest(unittest.TestCase): sys.setdlopenflags(oldflags) def test_refcount(self): + # n here must be a global in order for this test to pass while + # tracing with a python function. Tracing calls PyFrame_FastToLocals + # which will add a copy of any locals to the frame object, causing + # the reference count to increase by 2 instead of 1. + global n self.assertRaises(TypeError, sys.getrefcount) c = sys.getrefcount(None) n = None diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py index c9294b1..409a4f0 100644 --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -624,7 +624,11 @@ class CGIHandlerTestCase(unittest.TestCase): sys.stdin = open("xmldata.txt", "r") sys.stdout = open(test_support.TESTFN, "w") - self.cgi.handle_request() + os.environ['CONTENT_LENGTH'] = str(len(data)) + try: + self.cgi.handle_request() + finally: + del os.environ['CONTENT_LENGTH'] sys.stdin.close() sys.stdout.close() |