Commit graph

16092 commits

Author SHA1 Message Date
R. David Murray
ab9d8d64a7 Escape file path before searching for it in output via regex 2010-12-27 00:03:13 +00:00
R. David Murray
b4ca59b783 #5258/#10642: print fn, line, traceback and continue when .pth file is broken
If a .pth file contained an error, it could cause a traceback in site.py,
terminating its processing.  In 2.7 and 3.2, the interpreter will then not
start.  Previously, a message would print saying to use -v to get the
traceback.  In either case, the traceback generated for a failed .pth file did
not include the .pth filename, making it difficult to debug the problem.  Now
site.py reports not only the .pth filename but also the line number causing the
error, and just skips the remainder of the file.
2010-12-26 19:54:29 +00:00
Victor Stinner
667d4b577f Issue #10763: subprocess.communicate() closes stdout and stderr if both are
pipes (bug specific to Windows).

Improve also the unit test: write a portable unit test.
2010-12-25 22:40:32 +00:00
Brian Quinlan
291151b7f4 Assign closed handles to None to make errors more obvious if they are used. 2010-12-25 00:18:27 +00:00
Brian Quinlan
a3015a6a82 Better reporting of test failures on Windows. 2010-12-24 23:10:41 +00:00
R. David Murray
dfd7eb0ba2 #1693546: don't add quotes around RFC 2231 encoded values.
The RFC is bit hard to understand on this point, but the examples
clearly show that parameter values that are encoded according
to its charset/language rules don't have surrounding quotes, and
the ABNF does not allow for quotes.  So when we produce such
encoded values, we no longer add quotes.
2010-12-24 22:36:49 +00:00
Raymond Hettinger
57bd00a15b Adopt symmetric names for arguments (actual/expected --> first/second). 2010-12-24 21:51:48 +00:00
Raymond Hettinger
efbcb1b038 Keep helper functions private. 2010-12-24 11:24:00 +00:00
Raymond Hettinger
9d668dac68 Put diff output in useful order (when the elements were first seen). 2010-12-24 11:20:30 +00:00
Raymond Hettinger
f954217458 Add direct tests for the util functions. 2010-12-24 10:30:06 +00:00
Raymond Hettinger
93e233d6e5 Improve diff for assertCountEqual() to actually show the differing counts.
New output looks like this:

Traceback (most recent call last):
  File "test.py", line 5, in test_ce
    self.assertCountEqual('abracadabra xx', 'simsalabim xx')
AssertionError: Element counts were not equal:
Expected 5, got 2:  'a'
Expected 2, got 1:  'b'
Expected 0, got 2:  'i'
Expected 0, got 2:  'm'
Expected 0, got 1:  'l'
Expected 0, got 2:  's'
Expected 1, got 0:  'c'
Expected 1, got 0:  'd'
Expected 2, got 0:  'r'
2010-12-24 10:02:22 +00:00
Senthil Kumaran
1e991f2de5 Fix some mistakes- Issue3243 (r87399) Correcting the operator precendence
problem with Content-Length header and uncommenting the test.
2010-12-24 04:03:59 +00:00
Raymond Hettinger
c44befb82e Fix docstring. 2010-12-24 00:58:34 +00:00
Raymond Hettinger
6518f5e780 Fix docs and comment for r87454. 2010-12-24 00:52:54 +00:00
Raymond Hettinger
83961245b4 Add test for r87454. 2010-12-24 00:48:47 +00:00
Benjamin Peterson
bc78e37d46 update comment 2010-12-23 23:45:39 +00:00
Éric Araujo
1696f822e8 Fix syntax typo 2010-12-23 23:18:41 +00:00
Terry Reedy
d149c6c89c Issue 10730: mimetypes module - add .svgz to mimetypes.suffix_map and .svg to types_map.
Addition OKed by GB on IRC (R. David Murray). No backport.
2010-12-23 23:10:28 +00:00
Benjamin Peterson
31e8720324 kill some function imports 2010-12-23 22:53:42 +00:00
Benjamin Peterson
a91dd1e411 use native tenary condition 2010-12-23 22:49:38 +00:00
Benjamin Peterson
5793e6f4b0 fix docstring 2010-12-23 22:17:42 +00:00
Raymond Hettinger
d65a901aed Fix buglet. If the input was an iterator, the fallback would occur after
part of the iterator had been consumed.   Also, fix argument names which
did not match the docs and were a bit misleading.
2010-12-23 21:54:02 +00:00
R. David Murray
4a62e89728 #1155362: allow hh:mm:ss-uuuu like we allow hh:mm:ss+uuuu in parsedate_tz
Original patch by Thomas Herve.
2010-12-23 20:35:46 +00:00
R. David Murray
25b8cca6e8 #4496: remove misleading comment and note that self.handlers is obsolete.
self.handlers is still used in one urllib2 test, but not by the code iteslf.
2010-12-23 19:44:49 +00:00
Éric Araujo
a63c240847 Fix typo in superclass method name 2010-12-23 19:13:05 +00:00
Éric Araujo
413d7b4f24 Nits: use a real boolean, make one docstring more similar to the other ones 2010-12-23 18:44:31 +00:00
Éric Araujo
d699255b42 Fix small inaccuracy: there is no index function 2010-12-23 18:41:33 +00:00
Alexander Belopolsky
86f65d5dbb Issue #10254: Fixed a crash and a regression introduced by the implementation of PRI 29. 2010-12-23 02:27:37 +00:00
Antoine Pitrou
70df8f8c67 Fix ResourceWarning in test_normalization 2010-12-22 22:19:15 +00:00
R. David Murray
8d855d8304 #4871: check that zipfile password is bytes, and give useful error message.
Previously passing a string in as the password would fail either with
an assertion error or a TypeError with a confusing error message.
Note that a string can't be accepted since zipfile has no way to
guess what encoding should be used to turn it into bytes.

Patch by Victor Stinner.
2010-12-21 21:53:37 +00:00
Antoine Pitrou
7f8f41808b Issue #10750: The raw attribute of buffered IO objects is now read-only. 2010-12-21 21:20:59 +00:00
Raymond Hettinger
8ebe27f300 Deprecate assertDictContainsSubset() 2010-12-21 19:24:26 +00:00
R. David Murray
e0436bcb24 Make test_compileall more robust by using -S to keep sys.path minimized.
Try this again, hopefully the right way this time.

Arfrever Taifersar Arahesis reported that test_compileall failed during Gentoo
install because it was tyring to write .pyc files to a read-only system
directory during test_no_args_compiles_path.  Having the tests call python
with -S should eliminate the system directories from the path.
2010-12-21 18:24:33 +00:00
R. David Murray
73a559d0c9 Fix the change made for issue 1243654.
Surprisingly, it turns out there was no test that exercised this code path.
2010-12-21 18:07:59 +00:00
R. David Murray
92812028f2 Revert incorrect patch made at the wrong time. 2010-12-20 19:04:51 +00:00
R. David Murray
bf9004483d Make test_compileall more robust by using -S to keep sys.path minimized.
Arfrever Taifersar Arahesis reported that test_compileall failed during Gentoo
install because it was tyring to write .pyc files to a read-only system
directory during test_no_args_compiles_path.  Having subprocess call python
with -S should eliminate the system directories from the path.
2010-12-20 18:08:59 +00:00
Georg Brandl
09a7df8301 #3243 follow-up: remove debugging print and fix docs; data is a bytes object. 2010-12-19 12:33:52 +00:00
Senthil Kumaran
7bc0d872dd Issue3243 - Support iterable bodies in httplib. Patch contributions by Xuanji Li and Chris AtLee. 2010-12-19 10:49:52 +00:00
Georg Brandl
8a60e94802 Bump to 3.2b2. 2010-12-19 10:30:28 +00:00
Georg Brandl
3de338f47e Update pydoc topics. 2010-12-19 10:25:28 +00:00
Georg Brandl
cf8a209ab7 Temporarily skip test failing with newer ttk. 2010-12-19 10:17:46 +00:00
Georg Brandl
aedd2899c2 #6075: make idle work with both Carbon AquaTk and Cocoa AquaTk. Patch by Kevin Walzer and Ned Deily. 2010-12-19 10:10:32 +00:00
Michael Foord
cca5be2e4c Improvement to fix for issue 9926 to allow TestResult to be reused. 2010-12-19 04:07:28 +00:00
Michael Foord
f100dbd600 Fix minor issue in implementation of issue 10470. 2010-12-19 03:59:10 +00:00
Michael Foord
b3468f79ef Issue 10611. Issue 9857. Improve the way exception handling, including test skipping, is done inside TestCase.run 2010-12-19 03:19:47 +00:00
Ezio Melotti
addc6f5a21 #10573: use actual/expected consistently in unittest methods. The order of the args of assertCountEqual is also changed. 2010-12-18 20:00:04 +00:00
R. David Murray
63563cdf9d #9286: Fix the rfc822 parser to preserve whitespace in address local part.
Such addresses are not RFC compliant except under the 'obsolete syntax'
rules, but before this fix the whitespace was dropped from the input,
concatenating the pieces.  That breaks one of the principles of the
email package, that of preserving the input as much as possible.
It also denies the application program the opportunity to apply its
own heuristics to interpretation of such non-compliant addresses.

It is possible users of the email package were depending on the local
part always being a single token, so this fix will not be backported.
2010-12-18 18:25:38 +00:00
Ezio Melotti
3044fa77a5 Use lowercase true/false in assertTrue/assertFalse messages. 2010-12-18 17:31:58 +00:00
R. David Murray
b68a7bc70c #10404: Use ctl-button-1 for context menus on OSX Idle.
This provides access to the context menus where they previously could
not be accessed due to the way OSX Tk binds buttons.  It also
improves platform consistency.

Patch by Ned Deily.
2010-12-18 17:19:10 +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