summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-04-05 21:21:05 (GMT)
committerGeorg Brandl <georg@python.org>2009-04-05 21:21:05 (GMT)
commit9b08e05e1eb64aff77b6dc77226b1794bd33a154 (patch)
treed35fd76312a076d60610bc56dce5d541ded33c52 /Lib
parent8943caf716095082d6277110919a1c4c63487820 (diff)
downloadcpython-9b08e05e1eb64aff77b6dc77226b1794bd33a154.zip
cpython-9b08e05e1eb64aff77b6dc77226b1794bd33a154.tar.gz
cpython-9b08e05e1eb64aff77b6dc77226b1794bd33a154.tar.bz2
Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r70866 | georg.brandl | 2009-03-31 21:06:57 +0200 (Di, 31 Mär 2009) | 1 line #4882: document named group behavior a bit better. ........ r70867 | georg.brandl | 2009-03-31 21:10:35 +0200 (Di, 31 Mär 2009) | 1 line #1096310: document usage of sys.__std*__ a bit better. ........ r70868 | georg.brandl | 2009-03-31 21:12:17 +0200 (Di, 31 Mär 2009) | 1 line #5190: export make_option in __all__. ........ r70870 | georg.brandl | 2009-03-31 21:26:24 +0200 (Di, 31 Mär 2009) | 1 line #4411: document mro() and __mro__. (I hope I got it right.) ........ r70871 | georg.brandl | 2009-03-31 21:30:56 +0200 (Di, 31 Mär 2009) | 1 line #5618: fix typo. ........ r70893 | georg.brandl | 2009-03-31 22:56:32 +0200 (Di, 31 Mär 2009) | 1 line #1530012: move TQS section before raw strings. ........ r70896 | georg.brandl | 2009-03-31 23:15:33 +0200 (Di, 31 Mär 2009) | 1 line #5598: document DocFileSuite *args argument. ........ r70902 | georg.brandl | 2009-03-31 23:43:03 +0200 (Di, 31 Mär 2009) | 1 line #1675026: add a note about a strange Windows problem, and remove notes about AtheOS. ........ r70905 | georg.brandl | 2009-04-01 00:03:40 +0200 (Mi, 01 Apr 2009) | 1 line #5563: more documentation for bdist_msi. ........ r70907 | georg.brandl | 2009-04-01 00:18:19 +0200 (Mi, 01 Apr 2009) | 1 line #3427: document correct return type for urlopen().info(). ........ r70912 | georg.brandl | 2009-04-01 00:35:46 +0200 (Mi, 01 Apr 2009) | 1 line #5617: add a handy function to print a unicode string to gdbinit. ........ r70915 | georg.brandl | 2009-04-01 00:40:16 +0200 (Mi, 01 Apr 2009) | 1 line #5018: remove confusing paragraph. ........ r70927 | georg.brandl | 2009-04-01 01:01:27 +0200 (Mi, 01 Apr 2009) | 1 line Dont shout to users. ........ r70933 | georg.brandl | 2009-04-01 02:04:33 +0200 (Mi, 01 Apr 2009) | 2 lines Issue #5635: Fix running test_sys with tracing enabled. ........ r70940 | georg.brandl | 2009-04-01 06:21:14 +0200 (Mi, 01 Apr 2009) | 2 lines The SimpleXMLRPCServer's CGI handler now runs like a pony. ........ r70944 | georg.brandl | 2009-04-01 06:32:39 +0200 (Mi, 01 Apr 2009) | 1 line #5631: add upload to list of possible commands, which is presented in --help-commands. ........ r70954 | georg.brandl | 2009-04-01 17:23:43 +0200 (Mi, 01 Apr 2009) | 1 line Fix test_xmlrpc and make the CGI handler work with no CONTENT_LENGTH. ........ r70963 | georg.brandl | 2009-04-01 19:46:01 +0200 (Mi, 01 Apr 2009) | 1 line #5655: fix docstring oversight. ........ r70998 | georg.brandl | 2009-04-01 23:54:21 +0200 (Mi, 01 Apr 2009) | 1 line In Pdb, stop assigning values to __builtin__._ which interferes with the one commonly installed by gettext. ........ r71056 | georg.brandl | 2009-04-02 19:43:07 +0200 (Do, 02 Apr 2009) | 2 lines Actually the displayhook should print the repr. ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/SimpleXMLRPCServer.py6
-rw-r--r--Lib/distutils/command/__init__.py2
-rw-r--r--Lib/glob.py2
-rw-r--r--Lib/optparse.py1
-rwxr-xr-xLib/pdb.py9
-rw-r--r--Lib/test/test_sys.py5
-rw-r--r--Lib/test/test_xmlrpc.py6
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',
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 3f76032..e9f5632 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -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()