Commit graph

10439 commits

Author SHA1 Message Date
Nadeem Vawda
e860404eb7 Add a function lzma.open(), to match gzip.open() and bz2.open(). 2012-06-04 23:38:12 +02:00
Nadeem Vawda
6cbb20cdf6 Allow LZMAFile to accept modes with a "b" suffix. 2012-06-04 23:36:24 +02:00
Nadeem Vawda
33c34da574 Simplify usage of LZMAFile's fileobj support, like with BZ2File. 2012-06-04 23:34:07 +02:00
Nadeem Vawda
af518c198e Add a function bz2.open(), to match gzip.open(). 2012-06-04 23:32:38 +02:00
Nadeem Vawda
aebcdba829 Make BZ2File's fileobj support easier to use.
The fileobj argument was added during the 3.3 development cycle, so this change
does not break backward compatibility with 3.2.
2012-06-04 23:31:20 +02:00
Nadeem Vawda
68721019ef Add fileobj support to gzip.open(). 2012-06-04 23:21:38 +02:00
R David Murray
05cab75d59 #8739: fix omission of DEBUGSTREAM reset in new test in test_smtpd.
This clears up an error in detected by refleak mode that showed up when
test_smtplib was run after test_smtpd in the same refleak run.
2012-06-04 15:55:51 -04:00
Hynek Schlawack
454a74df23 #14814: Remove dead code from ipaddress
_BaseNetwork contained (faulty) methods for creating string representations.
I've fixed them and put them to use by eliminating identical overrides.
2012-06-04 18:14:02 +02:00
Barry Warsaw
efce00c537 Whitespace normalization 2012-06-04 12:02:42 -04:00
Barry Warsaw
028b37c941 PEP 421 requires that .name be lower case. 2012-06-04 12:01:56 -04:00
Barry Warsaw
c58c392da7 Trunk merge. 2012-06-04 09:41:48 -04:00
Hynek Schlawack
bcd304480f #14814: Use correct comparison for IP addresses
ipaddress._BaseV4.is_unspecified() compared IP addresses using "in" which
fails.
2012-06-04 14:19:39 +02:00
Gregory P. Smith
f0a9a9b502 Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
when the path existed and had the S_ISGID mode bit set when it was
not explicitly asked for.  This is no longer an exception as mkdir
cannot control if the OS sets that bit for it or not.
2012-06-03 14:35:09 -07:00
Gregory P. Smith
a81c856436 Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
when the path existed and had the S_ISGID mode bit set when it was not
explicitly asked for.  This is no longer an exception as mkdir cannot control
if the OS sets that bit for it or not.
2012-06-03 14:30:44 -07:00
Barry Warsaw
409da157d7 Eric Snow's implementation of PEP 421.
Issue 14673: Add sys.implementation
2012-06-03 16:18:47 -04:00
R David Murray
82ffabdfa4 #2658: Add test for issue fixed by fix for #1079. 2012-06-03 12:27:07 -04:00
R David Murray
07ea53cb21 #1079: Fix parsing of encoded words.
This is a behavior change: before this leading and trailing spaces were
stripped from ASCII parts, now they are preserved.  Without this fix we didn't
parse the examples in the RFC correctly, so I think breaking backward
compatibility here is justified.

Patch by Ralf Schlatterbeck.
2012-06-02 17:56:49 -04:00
Victor Stinner
0dec1bfef9 Fix sporadic failure of test_time.test_process_time() on Windows
Use a threshold of 20 ms instead of 10 ms.
2012-06-01 22:45:23 +02:00
Hynek Schlawack
35db513187 #14814: Fix errror message creation in ipaddress.collapse_addresses 2012-06-01 20:12:17 +02:00
Nick Coghlan
77452fc121 Close #14969: Improve the handling of exception chaining in contextlib.ExitStack 2012-06-01 22:48:32 +10:00
Eli Bendersky
2b6b73e7e1 Issue #14007: implement doctype() method calling in XMLParser of _elementtree.
Includes exposing a doctype handler from expat through pyexpat.
2012-06-01 11:32:34 +03:00
Eli Bendersky
52467b167e Issue #14007: make XMLParser a real subclassable type exported from _elementtree. +cleanups 2012-06-01 07:13:08 +03:00
R David Murray
1be413e366 Don't use metaclasses when class decorators can do the job.
Thanks to Nick Coghlan for pointing out that I'd forgotten about class
decorators.
2012-05-31 18:00:45 -04:00
Nick Coghlan
a5bd2a18ce Close #14963: Use an iterative algorithm in contextlib.ExitStack.__exit__ (Patch by Alon Horev) 2012-06-01 00:00:38 +10:00
Nick Coghlan
c73e8c2830 Issue #14963: Added test cases for contextlib.ExitStack exception handling behaviour (Initial patch by Alon Horev) 2012-05-31 23:49:26 +10:00
Vinay Sajip
d70be9ba1f Added test skip under Windows, as not applicable there. 2012-05-31 12:37:04 +01:00
R David Murray
56517e5cb9 Make parameterized tests in email less hackish.
Or perhaps more hackish, depending on your perspective.  But at least this
way it is now possible to run the individual tests using the unittest CLI.
2012-05-30 21:53:40 -04:00
Eli Bendersky
48d358ba86 Issue #14007: implemented the 'element_factory' feature of TreeBuilder in
_elementtree, with a test.
2012-05-30 17:57:50 +03:00
R David Murray
bb75678003 #14796: fix failure of new calendar test on windows. 2012-05-30 08:10:54 -04:00
Vinay Sajip
5e86eed33e Reapplied skip logic for test on Windows, which appears to have been lost during a merge. 2012-05-29 22:48:10 +01:00
Vinay Sajip
c1f0b53875 Updated test to reflect renamed file. 2012-05-29 22:29:50 +01:00
R David Murray
d0c8695617 #14796: improve calendar test coverage.
Patch by Oleg Plakhotnyuk.
2012-05-29 12:55:05 -04:00
R David Murray
026ba312d4 #10839: add new test file that was omitted from checkin 2012-05-29 12:31:11 -04:00
Eli Bendersky
58d548dff1 Issue #14007: make TreeBuilder an actual type exposed from _elementtree, and subclassable. 2012-05-29 15:45:16 +03:00
Hynek Schlawack
52209d3a1e #14835: Make plistlib output empty arrays & dicts like OS X
Patch by Sidney San Martín.
2012-05-29 12:04:54 +02:00
Eli Bendersky
737b173355 Issue 14814: Add namespaces keyword arg to find(*) methods in _elementtree.
Add attrib keyword to Element and SubElement in _elementtree.
Patch developed with Ezio Melotti.
2012-05-29 06:02:56 +03:00
R David Murray
6bed342b58 Refactor test_email/test_pickleable and add tests for date headers 2012-05-28 21:09:04 -04:00
R David Murray
a7c9ddb59c Regularize test_email/test_headerregistry's references to policy. 2012-05-28 20:22:37 -04:00
R David Murray
d41595b920 Refactor test_email/test_defect_handling. 2012-05-28 20:14:10 -04:00
Richard Oudkerk
3e0a1eb889 Issue #14930: Make memoryview objects weakrefable. 2012-05-28 21:35:09 +01:00
Vinay Sajip
ef4c5010e4 Fixed typo. 2012-05-28 17:01:17 +01:00
Vinay Sajip
382a7c0180 Tweaked tests to use launcher executable name on OS X. 2012-05-28 16:34:47 +01:00
R David Murray
7ef3ff3f2e #12515: email now registers a defect if the MIME end boundary is missing.
This commit also restores the news item for 167256 that it looks like
Terry inadvertently deleted.  (Either that, or I don't understand
now merging works...which is equally possible.)
2012-05-27 22:20:42 -04:00
R David Murray
80e0aee95b #1672568: email now registers defects for base64 payload format errors.
Which also means that it is now producing *something* for any base64
payload, which is what leads to the couple of older test changes in
test_email.  This is a slightly backward incompatible behavior change,
but the new behavior is so much more useful than the old (you can now
*reliably* detect errors, and any program that was detecting errors by
sniffing for a base64 return from get_payload(decode=True) and then doing
its own error-recovery decode will just get the error-recovery decode
right away).  So this seems to me to be worth the small risk inherent
in this behavior change.

This patch also refactors the defect tests into a separate test file,
since they are no longer just parser tests.
2012-05-27 21:23:34 -04:00
R David Murray
adbdcdbd95 #14925: email now registers a defect for missing header/body separator.
This patch also deprecates the MalformedHeaderDefect.  My best guess is that
this defect was rendered obsolete by a refactoring of the parser, and the
corresponding defect for the new parser (which this patch introduces) was
overlooked.
2012-05-27 20:45:01 -04:00
R David Murray
ea9766897b Make headerregistry fully part of the provisional api.
When I made the checkin of the provisional email policy, I knew that
Address and Group needed to be made accessible from somewhere.  The more
I looked at it, though, the more it became clear that since this is a
provisional API anyway, there's no good reason to hide headerregistry as
a private API.  It was designed to ultimately be part of the public API,
and so it should be part of the provisional API.

This patch fully documents the headerregistry API, and deletes the
abbreviated version of those docs I had added to the provisional policy
docs.
2012-05-27 15:03:38 -04:00
Vinay Sajip
393da3240a Changed executable name computation in test_venv to allow for debug executables. 2012-05-27 19:05:36 +01:00
Vinay Sajip
b3b49cd1d2 Refined venv tests. 2012-05-27 18:39:22 +01:00
Vinay Sajip
7e203498d1 Fixed _sys_home computation and added diagnostics for Windows buildbot failures. 2012-05-27 17:30:09 +01:00
Nick Coghlan
0b43bcf528 Close #14857: fix regression in references to PEP 3135 implicit __class__ closure variable. Reopens issue #12370, but also updates unittest.mock to workaround that issue 2012-05-27 18:17:07 +10:00