Commit Graph

13326 Commits

Author SHA1 Message Date
Barry Warsaw 409da157d7 Eric Snow's implementation of PEP 421.
Issue 14673: Add sys.implementation
2012-06-03 16:18:47 -04:00
Senthil Kumaran fe4dfd2b65 merge heads 2012-06-03 16:16:39 +08:00
Senthil Kumaran 1251fafcc5 Issue 14989: http.server --cgi option can enable the CGI http server. 2012-06-03 16:15:54 +08:00
Eli Bendersky 0813168e94 Issue #14090: fix some minor C API problems in default branch (3.3) 2012-06-03 08:07:47 +03:00
Eli Bendersky 11cfea9295 Issue #14424: Document PyType_GenericAlloc, and fix the documentation of PyType_GenericNew 2012-06-03 06:47:53 +03:00
Sandro Tosi 7f671338de backport c4bd68be5fc6 to 3.2 2012-06-02 23:41:19 +02:00
Sandro Tosi a894cbfa61 merge with 3.2 2012-06-02 18:22:31 +02:00
Sandro Tosi 964f205a34 refer to time.strftime 2012-06-02 18:22:02 +02:00
R David Murray f4b26ef250 #14957: fix doc typo. 2012-06-02 11:20:53 -04:00
R David Murray 554b3481fa #14957: fix doc typo. 2012-06-02 11:20:29 -04:00
Sandro Tosi c816290059 Issue #14814: use print() function 2012-06-02 17:16:33 +02:00
R David Murray 5a0d439126 #14957: clarify splitlines docs.
Initial patch by Michael Driscoll, I added the example.
2012-06-01 16:20:26 -04:00
R David Murray ae1b94b6e4 #14957: clarify splitlines docs.
Initial patch by Michael Driscoll, I added the example.
2012-06-01 16:19:36 -04:00
Sandro Tosi c10584a0d9 Issue #14968: merge with 3.2 2012-06-01 20:23:46 +02:00
Sandro Tosi 3f7d1d3303 Issue #14968: set 'Inplace Operators' as subsection; patch by Lars Buitinck 2012-06-01 20:23:20 +02:00
Eli Bendersky 1bf239446f fix trailing whitespace 2012-06-01 07:15:00 +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
Nick Coghlan b7a455f326 Typo fix 2012-05-31 22:34:59 +10:00
Nick Coghlan 2722827071 Additional ExitStack examples, and a few other cleanups for the ExitStack docs 2012-05-31 22:17:08 +10:00
Georg Brandl 01d7058d6a Merge heads. 2012-05-30 22:04:57 +02:00
Georg Brandl 3539afd5c9 Update pydoc topics and fix new suspicious markup. 2012-05-30 22:03:20 +02: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
Nick Coghlan a0cf90e3b1 Close #14947: add missing cross-reference to Language Definition from the new dynamic type creation functions. Also cleaned up the general wording of the docs 2012-05-30 22:17:30 +10:00
Brian Curtin d648fa2627 Fix #14943. Merge 3.2 2012-05-29 18:36:40 -05:00
Brian Curtin 13c70345ca Fix #14943. Update the proper default value and list the proper argument names in the explanation. 2012-05-29 18:34:45 -05:00
R David Murray abfc37491c #10839: raise an error on add of duplicate unique headers in new email policies
This feature was supposed to be part of the initial email6 checkin, but it got
lost in my big refactoring.

In this patch I'm not providing an easy way to turn off the errors, but they
only happen when a header is added programmatically, and it is almost never
the right thing to do to allow the duplicate to be added.  An application that
needs to add duplicates of unique headers can create a policy subclass to
allow it.
2012-05-29 09:14:44 -04:00
Vinay Sajip aa88d32574 Merged upstream changes. 2012-05-29 12:53:00 +01:00
Vinay Sajip 4126a7dc17 Added pyvenv docs to 'Python Setup and Usage' section. 2012-05-29 12:52:14 +01:00
Richard Oudkerk 87ea780e8e Use Python 3.x-style keyword only arg in Array()
Previously a Python 2.x compatible hack was used for
multiprocessing.sharedctypes.Array().  Also the documented
signature was wrong.
2012-05-29 12:01:47 +01: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 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 e1398f77ea #11785: fix the :mod: references in email package submodule titles. 2012-05-27 17:17:53 -04:00
R David Murray 79cf3bad1b #11785: fix the :mod: references in email package submodule titles.
Also adds the TOC entry for headerregistry.
2012-05-27 17:10:36 -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
Georg Brandl 38e0e1ec85 Fix markup. 2012-05-27 09:31:10 +02:00
R David Murray d1a30c939c #8739: upgrade smtpd to RFC 5321 and 1870.
smtpd now handles EHLO and has infrastructure for extended smtp command mode.
The SIZE extension is also implemented.  In order to support parameters on
MAIL FROM, the RFC 5322 parser from the email package is used to parse the
address "token".

Logging subclasses things and overrides __init__, so it was necessary to
update those __init__ functions in the logging tests to make the logging tests
pass.

The original suggestion and patch were by Alberto Trevino.  Juhana Jauhiainen
added the --size argument and SIZE parameter support.  Michele Orrù improved
the patch and added more tests.  Dan Boswell conditionalized various bits of
code on whether or not we are in HELO or EHLO mode, as well as some other
improvements and tests.  I finalized the patch and added the address parsing.
2012-05-26 14:33:59 -04:00
Nick Coghlan 53c920052b Issue #14814: Add a basic ipaddress tutorial (thanks to Sandro Tosi for the initial conversion from Peter Moody's wiki version) 2012-05-27 01:53:33 +10:00
Georg Brandl 039b01d015 Add missing versionadded. 2012-05-26 09:11:22 +02:00
R David Murray d2d521eafd #665194: Add a localtime function to email.utils.
Without this function people would be tempted to use the other date functions
in email.utils to compute an aware localtime, and those functions are not as
good for that purpose as this code.  The code is Alexander Belopolsy's from
his proposed patch for issue 9527, with a fix (and additional tests) by Brian
K. Jones.
2012-05-25 23:22:59 -04:00
Vinay Sajip b5267631cb Merged upstream changes. 2012-05-26 03:48:27 +01:00
Vinay Sajip 7ded1f0f69 Implemented PEP 405 (Python virtual environments). 2012-05-26 03:45:29 +01:00
R David Murray cb448cf108 #12586: Expand What's New email entry with provisional policy features. 2012-05-25 22:25:56 -04:00
R David Murray 0b6f6c82b5 #12586: add provisional email policy with new header parsing and folding.
When the new policies are used (and only when the new policies are explicitly
used) headers turn into objects that have attributes based on their parsed
values, and can be set using objects that encapsulate the values, as well as
set directly from unicode strings.  The folding algorithm then takes care of
encoding unicode where needed, and folding according to the highest level
syntactic objects.

With this patch only date and time headers are parsed as anything other than
unstructured, but that is all the helper methods in the existing API handle.
I do plan to add more parsers, and complete the set specified in the RFC
before the package becomes stable.
2012-05-25 18:42:14 -04:00
R David Murray 0fa2edd08f #14731: add preliminary What's New entry for policy framework. 2012-05-25 17:59:56 -04:00
R David Murray c27e52265b #14731: refactor email policy framework.
This patch primarily does two things: (1) it adds some internal-interface
methods to Policy that allow for Policy to control the parsing and folding of
headers in such a way that we can construct a backward compatibility policy
that is 100% compatible with the 3.2 API, while allowing a new policy to
implement the email6 API.  (2) it adds that backward compatibility policy and
refactors the test suite so that the only differences between the 3.2
test_email.py file and the 3.3 test_email.py file is some small changes in
test framework and the addition of tests for bugs fixed that apply to the 3.2
API.

There are some additional teaks, such as moving just the code needed for the
compatibility policy into _policybase, so that the library code can import
only _policybase.  That way the new code that will be added for email6
will only get imported when a non-compatibility policy is imported.
2012-05-25 15:01:48 -04:00
Nick Coghlan b47b53941a Placeholder in What's New for the major packaging infrastructure changes 2012-05-26 01:31:25 +10:00
Petri Lehtinen fa52cbd5e6 #14863: Update the documentation of os.fdopen() 2012-05-24 21:49:59 +03:00
Petri Lehtinen 1a01ebc41c #14863: Update the documentation of os.fdopen()
There's no bufsize argument anymore, and os.fdopen() is only a very
thin wrapper around open() anymore. Change the documentation to
reflect that.
2012-05-24 21:46:36 +03:00
Hynek Schlawack f0bf135cd1 Restore [] where default arguments are not keywords 2012-05-22 16:14:56 +02:00
Hynek Schlawack 979f37afd2 Restore [] where default arguments are not keywords
Reverts some changes of d13fdd97cc8e.
2012-05-22 16:12:18 +02:00
Nick Coghlan 161ea6a349 Fix typo 2012-05-22 23:04:42 +10:00
Nick Coghlan a497b44238 Fix the versionadded tags for a couple of my recent changes 2012-05-22 23:02:00 +10:00
Georg Brandl 945a3ada7f Avoid useless indentation. 2012-05-21 20:28:58 +02:00
Antoine Pitrou 389e8c85cd Remove outdated statement. 2012-05-21 19:23:00 +02:00
Nick Coghlan 3267a30de1 Close #13585: add contextlib.ExitStack to replace the ill-fated contextlib.nested API 2012-05-21 22:54:43 +10:00
Hynek Schlawack 6e49ac2406 #14804: Remove [] around optional arguments with default values
3.3 specific additions to d13fdd97cc8e.
2012-05-21 13:41:25 +02:00
Hynek Schlawack 87d8200978 #14804: Remove [] around optional arguments with default values 2012-05-21 13:35:03 +02:00
Hynek Schlawack dfa465243c #14804: Remove [] around optional arguments with default values 2012-05-21 11:01:54 +02:00
Hynek Schlawack 44f7cf0b2f Fix `versionchanged` tags for json.load
`versionchanged` tags about 2.7 are useless in 3.x branches.
2012-05-20 18:34:11 +02:00
Hynek Schlawack f54c0604c8 Fix `versionchanged` tags for json.load
`versionchanged` tags about 2.7 are useless in 3.x branches.
2012-05-20 18:32:53 +02:00
Vinay Sajip 07162d4142 Closes #14864: Added documentation on how to undo the effects of a logging.disable() call. Thanks to user Guillaume for the suggestion. 2012-05-20 15:37:33 +01:00
Vinay Sajip 69d8493899 Fixes #14864: Added documentation on how to undo the effects of a logging.disable() call. 2012-05-20 15:36:17 +01:00
Nick Coghlan 305acf2fff Remove an incorrect implementation detail 2012-05-20 21:22:27 +10:00
Nick Coghlan dc9b2555a8 Issue #14814: addition of the ipaddress module (stage 1 - code and tests) 2012-05-20 21:01:57 +10:00
Hynek Schlawack 7db768cf0e Document when json.load's parse_constant behaviour changed
It doesn't get called on 'null', 'true', 'false' since f686aced02a3.
2012-05-20 12:04:01 +02:00
Hynek Schlawack 1203e83d28 Document when json.load's parse_constant behaviour changed
It doesn't get called on 'null', 'true', 'false' since f686aced02a3.
2012-05-20 12:03:17 +02:00
Charles-François Natali 6c7bf42656 Merge. 2012-05-20 11:43:28 +02:00
Charles-François Natali b93f9fa700 Issue #12760: Add some mising documentation about the new `x` exclusive
creation flag to open().
2012-05-20 11:41:53 +02:00
Nick Coghlan b267475ccf Clarify a paragraph in the new metaclass docs 2012-05-20 19:36:40 +10:00
Nick Coghlan 337b2bfbc4 Describe the default hash correctly, and mark a couple of CPython implementation details 2012-05-20 18:30:49 +10:00
Nick Coghlan 78770f0b78 Fix typo in new metaclass docs 2012-05-20 18:15:11 +10:00
Raymond Hettinger 010ce3283a Minor change to default lru size. Set default to a power of two. 2012-05-19 21:20:48 -07:00
Nick Coghlan 7fc570a51e Close #14588: added a PEP 3115 compliant dynamic type creation mechanism 2012-05-20 02:34:13 +10:00
Petri Lehtinen 7c5ba513b9 #14494: Document that absolute imports became default in 3.0 instead of 2.7. 2012-05-19 18:38:43 +03:00
Petri Lehtinen 079bfc962d #14494: Document that absolute imports became default in 3.0 instead of 2.7. 2012-05-19 18:36:33 +03:00
Hynek Schlawack d527259f14 #13152: Allow to specify a custom tabsize for expanding tabs in textwrap
Patch by John Feuerstein.
2012-05-19 13:33:11 +02:00
Petri Lehtinen ed3639595a Fix time.time() references in the time module docs
Closes #14842.
2012-05-18 21:28:47 +03:00
Petri Lehtinen 1033b310a3 Fix time.time() references in the time module docs
Closes #14842.
2012-05-18 21:22:47 +03:00
Antoine Pitrou fc6acccbaf Remove outdated statements about threading and imports. 2012-05-18 13:57:04 +02:00
Antoine Pitrou 79341e7865 Add a mention of the new import locks in whatsnew. 2012-05-17 21:13:45 +02:00
Antoine Pitrou 6c6d3a2f9f Move import lock-related functions to a separate doc section. 2012-05-17 19:00:35 +02:00
Antoine Pitrou ea3eb88bca Issue #9260: A finer-grained import lock.
Most of the import sequence now uses per-module locks rather than the
global import lock, eliminating well-known issues with threads and imports.
2012-05-17 18:55:59 +02:00
Antoine Pitrou 5cec9d2ae5 Add mention of decoding optimizations in the what's new document. 2012-05-17 17:37:02 +02:00
R David Murray dd95974509 #14823: Simplify threading.Lock.acquire argument discussion. 2012-05-17 09:14:28 -04:00
R David Murray f7a6615719 #14823: Simplify threading.Lock.acquire argument discussion. 2012-05-17 09:13:30 -04:00
Antoine Pitrou de9ac6c2e5 Issue #14780: urllib.request.urlopen() now has a `cadefault` argument to use the default certificate store.
Initial patch by James Oakley.
2012-05-16 21:40:01 +02:00
Hynek Schlawack 07542a0629 #14692 Fix json docs to reflect changes in json.load
The behaviour of the parse_constant callback changed insofar that 'null',
'true', 'false' don't trigger its call anymore.

Patch by Serhiy Storchaka
2012-05-16 19:08:36 +02:00
Hynek Schlawack 9729fd4427 #14692 Fix json docs to reflect changes in json.load
The behaviour of the parse_constant callback changed insofar that 'null',
'true', 'false' don't trigger its call anymore.

Patch by Serhiy Storchaka
2012-05-16 19:01:04 +02:00
Hynek Schlawack 51b2ed51f0 #14809: Add HTTP status codes from RFC 6585 to http.server and http.client
Patch by EungJun Yi.
2012-05-16 09:51:07 +02:00
R David Murray a32df1e0e6 merge #1440472: reflow 2012-05-15 22:13:55 -04:00
R David Murray 28e68ea6ea #1440472: reflow 2012-05-15 22:13:29 -04:00
R David Murray b3ad106dca merge #1440472: Explain that email parser/generator isn't *quite* "idempotent" 2012-05-15 22:09:14 -04:00
R David Murray ea1badbfef #1440472: Explain that email parser/generator isn't *quite* "idempotent" 2012-05-15 22:07:52 -04:00
Charles-François Natali 9b704ec9e1 Add versionadded for hmac.secure_compare(). 2012-05-15 21:00:32 +02:00
Giampaolo Rodola' 0fb41b56ea remove unused import in asyncore doc 2012-05-15 15:46:00 +02:00
Giampaolo Rodola' ffa1d0b8d5 #14807: move undocumented tarfile.filemode() to stat.filemode(). Add tarfile.filemode alias with deprecation warning. 2012-05-15 15:30:25 +02:00
Benjamin Peterson d5a1c44455 PEP 415: Implement suppression of __context__ display with an exception attribute
This replaces the original PEP 409 implementation. See #14133.
2012-05-14 22:09:31 -07:00
R David Murray d91dc62379 Merge #14766: Add correct algorithm for when a 'time' object is naive.
This patch also clarifies the definition of Naive and Aware.

Original patch by Greg Weller, I modified the first hunk
somewhat to make the exposition even clearer (I hope).
2012-05-14 22:19:10 -04:00