Commit Graph

13797 Commits

Author SHA1 Message Date
Jeremy Hylton 0381f48936 Send HTTP headers and message body in a single send() call.
This change addresses part of issue 4336.

Change endheaders() to take an optional message_body argument
that is sent along with the headers.  Change xmlrpclib and
httplib's other methods to use this new interface.

It is more efficient to make a single send() call, which should
get the entire client request into one packet (assuming it is
smaller than the MTU) and will avoid the long pause for delayed
ack following timeout.

Also:
- Add a comment about the buffer size for makefile().
- Extract _set_content_length() method and fix whitespace issues there.
2008-11-29 01:09:35 +00:00
Jeremy Hylton 21d2e59ab1 Reflow long lines. 2008-11-29 00:09:16 +00:00
Benjamin Peterson 2555d9ddeb Merged revisions 67384,67386-67387,67389-67390,67392,67399-67400,67403-67405,67426 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r67384 | benjamin.peterson | 2008-11-25 16:13:31 -0600 (Tue, 25 Nov 2008) | 4 lines

  don't duplicate calls to start_tree()

  RefactoringTool.pre_order values now holds a list of the fixers while pre_order_mapping holds the dict.
........
  r67386 | benjamin.peterson | 2008-11-25 16:44:52 -0600 (Tue, 25 Nov 2008) | 1 line

  #4423 fix_imports was still replacing usage of a module if attributes were being used
........
  r67387 | benjamin.peterson | 2008-11-25 16:47:54 -0600 (Tue, 25 Nov 2008) | 1 line

  fix broken test
........
  r67389 | benjamin.peterson | 2008-11-25 17:13:17 -0600 (Tue, 25 Nov 2008) | 1 line

  remove compatibility code; we only cater to 2.5+
........
  r67390 | benjamin.peterson | 2008-11-25 22:03:36 -0600 (Tue, 25 Nov 2008) | 1 line

  fix #3994; the usage of changed imports was fixed in nested cases
........
  r67392 | benjamin.peterson | 2008-11-26 11:11:40 -0600 (Wed, 26 Nov 2008) | 1 line

  simpilfy and comment fix_imports
........
  r67399 | benjamin.peterson | 2008-11-26 11:47:03 -0600 (Wed, 26 Nov 2008) | 1 line

  remove more compatibility code
........
  r67400 | benjamin.peterson | 2008-11-26 12:07:41 -0600 (Wed, 26 Nov 2008) | 1 line

  set svn:ignore
........
  r67403 | benjamin.peterson | 2008-11-26 13:11:11 -0600 (Wed, 26 Nov 2008) | 1 line

  wrap import
........
  r67404 | benjamin.peterson | 2008-11-26 13:29:49 -0600 (Wed, 26 Nov 2008) | 1 line

  build the fix_imports pattern in compile_pattern, so MAPPING can be changed and reflected in the pattern
........
  r67405 | benjamin.peterson | 2008-11-26 14:01:24 -0600 (Wed, 26 Nov 2008) | 1 line

  stop ugly messages about runtime errors being from printed
........
  r67426 | benjamin.peterson | 2008-11-28 16:01:40 -0600 (Fri, 28 Nov 2008) | 5 lines

  don't replace a module name if it is in the middle of a attribute lookup

  This fix also stops module names from being replaced if they are not in an attribute lookup.
........
2008-11-28 22:12:14 +00:00
Jesse Noller 1f8b49f517 issue4238: bsd support for cpu_count 2008-11-28 18:59:35 +00:00
Christian Heimes aa67471227 Fixed issue ##3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception 2008-11-28 11:02:32 +00:00
Benjamin Peterson b38e325e97 Merged revisions 67183,67191,67371 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r67183 | benjamin.peterson | 2008-11-10 21:51:33 -0600 (Mon, 10 Nov 2008) | 1 line

  handle 'import x as y' in fix_imports; this still needs more work...
........
  r67191 | benjamin.peterson | 2008-11-11 17:24:51 -0600 (Tue, 11 Nov 2008) | 1 line

  super() is good
........
  r67371 | benjamin.peterson | 2008-11-24 16:02:00 -0600 (Mon, 24 Nov 2008) | 1 line

  don't blow up in the metaclass fixer when assignments in the class statement aren't simple
........
2008-11-25 04:07:45 +00:00
Jeremy Hylton 8942011db1 Add unittests that verify documented behavior of public methods in Transport
class.

These methods can be overridden.  The tests verify that the overridden
methods are called, and that changes to the connection have a visible
effect on the request.
2008-11-24 22:00:29 +00:00
Benjamin Peterson 9dfe6a8862 #4396 make the parser module correctly validate the with syntax 2008-11-24 04:09:03 +00:00
Benjamin Peterson 21f25d3fcd raise a better error 2008-11-23 02:09:41 +00:00
Georg Brandl 5ecd7452ec Fix typo. 2008-11-22 08:45:33 +00:00
Benjamin Peterson bfc51567f5 backport r67325: make FileIO.mode always contain 'b' 2008-11-22 01:59:15 +00:00
Benjamin Peterson c078f929cb don't segfault when \N escapes are used and unicodedata fails to load
Fixes #4367
2008-11-21 22:27:24 +00:00
Amaury Forgeot d'Arc d42941751c #4363: Let uuid.uuid1() and uuid.uuid4() run even if the ctypes module is not present.
Will backport to 2.6
2008-11-21 22:05:48 +00:00
Amaury Forgeot d'Arc 322656596a Fixed issue #4233.
Changed semantic of _fileio.FileIO's close()  method on file objects with closefd=False.
The file descriptor is still kept open but the file object behaves like a closed file.
The FileIO  object also got a new readonly attribute closefd.

Approved by Barry

Backport of r67106 from the py3k branch
2008-11-20 23:34:31 +00:00
Benjamin Peterson ad100c3acb backport r67300 2008-11-20 22:06:22 +00:00
Benjamin Peterson d3b5a7985d oops! didn't mean to disable that test 2008-11-20 21:44:23 +00:00
Benjamin Peterson 46cc6d1102 make sure that bytearray methods return a new bytearray even if there is no change
Fixes #4348
Reviewed by Brett
2008-11-19 21:49:09 +00:00
Josiah Carlson a98d72d598 Fix for issue 4332 in trunk. 2008-11-19 18:26:12 +00:00
Martin v. Löwis bb9b1f1d4a Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__ 2008-11-19 09:09:41 +00:00
Skip Montanaro 7fb29797e3 patch from issue 1108 2008-11-19 03:35:41 +00:00
Amaury Forgeot d'Arc 7cfe7ea745 #4317: Fix an Array Bounds Read in imageop.rgb2rgb8.
Will backport to 2.4.
2008-11-18 22:19:37 +00:00
Benjamin Peterson 273c233c78 when __getattr__ is a descriptor, call it correctly; fixes #4230
patch from Ziga Seilnacht
2008-11-17 22:39:09 +00:00
Brett Cannon e3d0bf740f The docs for httplib.HTTPConnection.putheader() have claimed for quite a while
that their could be an arbitrary number of values passed in. Turns out the code
did not match that. The code now matches the docs.
2008-11-15 22:40:44 +00:00
Benjamin Peterson ba4d480776 Merged revisions 66985,67170,67173,67177-67179 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r66985 | benjamin.peterson | 2008-10-20 16:43:46 -0500 (Mon, 20 Oct 2008) | 1 line

  no need to use nested try, except, finally
........
  r67170 | benjamin.peterson | 2008-11-08 12:28:31 -0600 (Sat, 08 Nov 2008) | 1 line

  fix #4271: fix_imports didn't recognize imports with parenthesis (ie from x import (a, b))
........
  r67173 | benjamin.peterson | 2008-11-08 17:42:08 -0600 (Sat, 08 Nov 2008) | 1 line

  consolidate test
........
  r67177 | benjamin.peterson | 2008-11-09 21:52:52 -0600 (Sun, 09 Nov 2008) | 1 line

  let the metclass fixer handle complex assignments in the class body gracefully
........
  r67178 | benjamin.peterson | 2008-11-10 15:26:43 -0600 (Mon, 10 Nov 2008) | 1 line

  the metaclass fixers shouldn't die when bases are not a simple name
........
  r67179 | benjamin.peterson | 2008-11-10 15:29:58 -0600 (Mon, 10 Nov 2008) | 1 line

  allow the fix_import pattern to catch from imports with parenthesis
........
2008-11-10 22:11:12 +00:00
Benjamin Peterson b7c95ce8b8 fix comment 2008-11-09 01:52:32 +00:00
Benjamin Peterson 2c98faada6 check for assignment to __debug__ during AST generation
Also, give assignment to None a better error message
2008-11-08 18:38:54 +00:00
Benjamin Peterson 81e92e582e move a FileIO test to test_fileio 2008-11-03 22:34:57 +00:00
Hirokazu Yamamoto b9828f67b8 Issue #3774: Fixed an error when create a Tkinter menu item without command
and then remove it. Written by Guilherme Polo (gpolo).
2008-11-03 18:03:06 +00:00
Benjamin Peterson 6624a9fddd #4048 make the parser module accept relative imports as valid 2008-11-03 15:14:51 +00:00
Benjamin Peterson dcee09d920 make sure the parser flags and passed onto the compiler
This fixes "from __future__ import unicode_literals" in an exec statment
See #4225
2008-10-31 02:16:05 +00:00
Christian Heimes ab5f879022 Issue #4237: io.FileIO() was raising invalid warnings caused by insufficient initialization of PyFileIOObject struct members. 2008-10-30 21:26:15 +00:00
Amaury Forgeot d'Arc 69a9c5b539 Issue #4176: Pickle would crash the interpreter when a __reduce__ function
does not return an iterator for the 4th and 5th items.
(sequence-like and mapping-like state)

A list is not an iterator...

Will backport to 2.6 and 2.5.
2008-10-30 21:18:34 +00:00
Thomas Heller 1fac5a4505 Fixed a modulefinder crash on certain relative imports. 2008-10-30 20:18:13 +00:00
Armin Rigo 581eb1e498 Fix one of the tests: it relied on being present in an "output test" in
order to actually test what it was supposed to test, i.e. that the code
in the __del__ method did not crash.  Use instead the new helper
test_support.captured_output().
2008-10-28 17:01:21 +00:00
Benjamin Peterson 260f5bae70 add forgotten test for r67030 2008-10-26 20:33:19 +00:00
Benjamin Peterson bdca942ffc fix __future__ imports when multiple features are given 2008-10-26 20:21:13 +00:00
Benjamin Peterson 399b1fe8df give a py3k warning when 'nonlocal' is used as a variable name 2008-10-25 02:53:28 +00:00
Hirokazu Yamamoto 592c275567 Issue #4183: Some tests didn't run with pickle.HIGHEST_PROTOCOL. 2008-10-23 00:37:33 +00:00
Benjamin Peterson c18574c98e fix #4150: pdb's up command didn't work for generators in post-mortem 2008-10-22 21:16:34 +00:00
Benjamin Peterson 4d9b0cd409 return ArgInfo from inspect.getargvalues #4092 2008-10-21 22:18:29 +00:00
Amaury Forgeot d'Arc fbc0b0ca29 #4157 move two test functions out of platform.py.
Turn them into unit tests, and correct an obvious typo:
    (("a", "b") ("c", "d") ("e", "f"))
compiles even with the missing commas, but does not execute very well...
2008-10-21 22:01:38 +00:00
Benjamin Peterson 77c2f93663 make sure to call iteritems() 2008-10-21 20:51:13 +00:00
Armin Ronacher 297ddcd823 Fixed #4062, added import for _ast.__version__ to ast to match the documented behavior. 2008-10-20 21:29:08 +00:00
Benjamin Peterson 595e3cbb3d check for error conditions in _json #3623 2008-10-16 21:09:28 +00:00
Benjamin Peterson b76444b2fa use new showwarnings signature for idle #3391 2008-10-16 19:40:14 +00:00
Benjamin Peterson 6ae94ee299 Merged revisions 66805,66841,66860,66884-66886,66893,66907,66910 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r66805 | benjamin.peterson | 2008-10-04 20:11:02 -0500 (Sat, 04 Oct 2008) | 1 line

  mention what the fixes directory is for
........
  r66841 | benjamin.peterson | 2008-10-07 17:48:12 -0500 (Tue, 07 Oct 2008) | 1 line

  use assertFalse and assertTrue
........
  r66860 | benjamin.peterson | 2008-10-08 16:05:07 -0500 (Wed, 08 Oct 2008) | 1 line

  instead of abusing the pattern matcher, use start_tree to find a next binding
........
  r66884 | benjamin.peterson | 2008-10-13 15:50:30 -0500 (Mon, 13 Oct 2008) | 1 line

  don't print tokens to stdout when -v is given
........
  r66885 | benjamin.peterson | 2008-10-13 16:28:57 -0500 (Mon, 13 Oct 2008) | 1 line

  add the -x option to disable fixers
........
  r66886 | benjamin.peterson | 2008-10-13 16:33:53 -0500 (Mon, 13 Oct 2008) | 1 line

  cut down on some crud
........
  r66893 | benjamin.peterson | 2008-10-14 17:16:54 -0500 (Tue, 14 Oct 2008) | 1 line

  add an optional set literal fixer
........
  r66907 | benjamin.peterson | 2008-10-15 16:59:41 -0500 (Wed, 15 Oct 2008) | 1 line

  don't write backup files by default
........
  r66910 | benjamin.peterson | 2008-10-15 17:43:10 -0500 (Wed, 15 Oct 2008) | 1 line

  add the -n option; it stops backupfiles from being written
........
2008-10-15 23:10:28 +00:00
Benjamin Peterson 9dc0a639bd support the optional line argument for idle 2008-10-15 21:05:55 +00:00
Skip Montanaro c01e32118b easter egg 2008-10-15 11:49:10 +00:00
Benjamin Peterson 32e7aa6ab9 remove set compat cruft 2008-10-14 22:37:18 +00:00
Benjamin Peterson 76f71a52d7 give poplib a real test suite
#4088 from Giampaolo Rodola'x
2008-10-11 17:25:36 +00:00