Commit graph

3803 commits

Author SHA1 Message Date
Brian Curtin
c57a34577c Fix #444582. Add shutil.which function for finding programs on the system path. 2012-06-22 16:00:30 -05:00
Alexander Belopolsky
93c9cd07b6 Issue #9527: tm_gmtoff has 'correct' sign. 2012-06-22 16:04:19 -04:00
Antoine Pitrou
5f6213be2d Merge 2012-06-22 21:13:34 +02:00
Antoine Pitrou
3b36fb1f53 Issue #14837: SSL errors now have library and reason attributes describing precisely what happened and in which OpenSSL submodule.
The str() of a SSLError is also enhanced accordingly.

NOTE: this commit creates a reference leak.  The leak seems tied to the
use of PyType_FromSpec() to create the SSLError type.  The leak is on the
type object when it is instantiated:

>>> e = ssl.SSLError()
>>> sys.getrefcount(ssl.SSLError)
35
>>> e = ssl.SSLError()
>>> sys.getrefcount(ssl.SSLError)
36
>>> e = ssl.SSLError()
>>> sys.getrefcount(ssl.SSLError)
37
2012-06-22 21:11:52 +02:00
David Malcolm
49526f48fc Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues 2012-06-22 14:55:41 -04:00
Jesus Cea
9436361e4c Closes #10142: Support for SEEK_HOLE/SEEK_DATA 2012-06-22 18:32:07 +02:00
Alexander Belopolsky
fdc860f310 Issue #9527: datetime.astimezone() method will now supply a class
timezone instance corresponding to the system local timezone when
called with no arguments.
2012-06-22 12:23:23 -04:00
Nadeem Vawda
2180c97a00 Document the rest of zlib.compressobj()'s arguments.
Original patch by Jim Jewett; see issue 14684.
2012-06-22 01:40:49 +02:00
Nadeem Vawda
a425c3d5a2 Make lzma.{encode,decode}_filter_properties private.
These functions were originally added to support LZMA compression in the zipfile
module, and are not of interest for the majority of users.

They can be made public in 3.4 if there is user interest, but in the meanwhile,
I've opted to present a smaller, simpler API for the module's initial release.
2012-06-21 23:36:48 +02:00
Nadeem Vawda
fd8a838d58 Issue #14684: Add support for predefined compression dictionaries to the zlib module.
Original patch by Sam Rushing.
2012-06-21 02:13:12 +02:00
Brian Curtin
066dacf662 Add versionchanged tags for #14772 changes 2012-06-19 10:03:05 -05:00
Brian Curtin
0d0a1dedbc Fix #14772: Return the destination from some shutil functions. 2012-06-18 18:41:07 -05:00
Richard Oudkerk
633c4d9199 Issue #15064: Use with-blocks for some examples in docs. 2012-06-18 21:29:36 +01:00
Richard Oudkerk
ac38571f00 Issue #15064: Make BaseManager.__enter__() start server if necessary. 2012-06-18 21:29:30 +01:00
Richard Oudkerk
d69cfe88ea Issue #15064: Implement context manager protocol for multiprocessing types 2012-06-18 17:47:52 +01:00
Martin v. Löwis
1e5d0ff8a0 Elaborate that sizeof only accounts for the object itself. 2012-06-17 10:40:16 +02:00
Nick Coghlan
9680bdb567 Issue #14814: Add first draft of PEP 3144 ipaddress module documentation (initial patch by Sandro Tosi) 2012-06-17 17:24:10 +10:00
Alexander Belopolsky
0831382d69 Issue #15006: Allow equality comparison between naive and aware time
or datetime objects.
2012-06-15 20:19:47 -04:00
Brett Cannon
ea0b823940 Issue #14938: importlib.abc.SourceLoader.is_package() now takes the
module name into consideration when determining whether a module is a
package or not. This prevents importing a module's __init__ module
directly and having it considered a package, which can lead to
duplicate sub-modules.

Thanks to Ronan Lamy for reporting the bug.
2012-06-15 20:00:53 -04:00
Brett Cannon
47b3239cc6 Closes issue #14982: Document that pkgutil's walk_packages() and
iter_modules() requires iter_modules() be defined on an importer. The
importers in importlib do not define this non-standard method.
2012-06-15 19:21:07 -04:00
Richard Oudkerk
3730a17a58 Issue #14059: Implement multiprocessing.Barrier 2012-06-15 18:26:07 +01:00
Nick Coghlan
807770ec1b Issue #15061: Don't oversell the capabilities of the new non-shortcircuiting comparison function in hmac 2012-06-15 21:14:08 +10:00
Alexander Belopolsky
c142bba2a7 Issue #1667546: On platforms supporting tm_zone and tm_gmtoff fields
in struct tm, time.struct_time objects returned by time.gmtime(),
time.localtime() and time.strptime() functions now have tm_zone and
tm_gmtoff attributes.  Original patch by Paul Boddie.
2012-06-13 22:15:26 -04:00
Sandro Tosi
f6a899fe6d Issue #15060: merge with 3.2 2012-06-14 00:37:25 +02:00
Sandro Tosi
27b130e702 Issue #15060: better fix, thanks to review on #python-dev 2012-06-14 00:37:09 +02:00
Sandro Tosi
9994b096d1 Issue #15060: merge with 3.2 2012-06-13 23:59:21 +02:00
Sandro Tosi
56692f5722 Issue #15060: fix typo in socket doc; Patch by anatoly techtonik 2012-06-13 23:58:54 +02:00
Victor Stinner
2b89fdf7eb PEP 418: Rename adjusted attribute to adjustable in time.get_clock_info() result
Fix also its value on Windows and Linux according to its documentation:
"adjustable" indicates if the clock *can be* adjusted, not if it is or was
adjusted.

In most cases, it is not possible to indicate if a clock is or was adjusted.
2012-06-12 22:46:37 +02:00
Victor Stinner
bda4b8802c time.get_clock_info() uses a namespace instead of structseq 2012-06-12 22:11:44 +02:00
Richard Oudkerk
f0604fddc3 Issue #3518: Remove references to non-existent BaseManager.from_address()
method
2012-06-11 17:56:08 +01:00
Nick Coghlan
4fae8cdaea Close #13857: Added textwrap.indent() function (initial patch by Ezra
Berch)
2012-06-11 23:07:51 +10:00
Raymond Hettinger
3c4acd8bf9 merge 2012-06-11 00:42:17 -07:00
Raymond Hettinger
6fed9fdf22 Fix indentation of method and attribute examples. 2012-06-11 00:38:14 -07:00
Michael Foord
911fd327f1 unittest.mock minor doc update 2012-06-10 20:38:54 +01:00
Michael Foord
f7c4158057 Adding patch.stopall method to unittest.mock 2012-06-10 20:36:32 +01:00
Raymond Hettinger
bfcb42936b Expand examples for ChainMap(). Improve markup. 2012-06-10 11:39:44 -07:00
Raymond Hettinger
7929cfb18c Note that the _asdict() method is outdated 2012-06-09 19:15:26 -07:00
Alexander Belopolsky
a4415141da Issue #2736: Added datetime.timestamp() method. 2012-06-08 12:33:09 -04:00
Victor Stinner
a01f1adb87 Close #6203: Document that Python 3 sets LC_CTYPE at startup to the user's preferred locale encoding 2012-06-06 01:37:37 +02:00
Victor Stinner
f86a5e8a93 Close #11022: TextIOWrapper doesn't call locale.setlocale() anymore
open() and io.TextIOWrapper are now calling locale.getpreferredencoding(False)
instead of locale.getpreferredencoding() in text mode if the encoding is not
specified. Don't change temporary the locale encoding using locale.setlocale(),
use the current locale encoding instead of the user preferred encoding.

Explain also in open() documentation that locale.getpreferredencoding(False) is
called if the encoding is not specified.
2012-06-05 13:43:22 +02:00
Victor Stinner
034d0aa217 Issue #14711: os.stat_float_times() has been deprecated. 2012-06-05 01:22:15 +02:00
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
50cb936bd0 Clarify acceptable values for BZ2File.__init__'s mode argument. 2012-06-04 23:31:22 +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
Barry Warsaw
9b10e1fbb9 A few documentation improvements, spurred on by Brett's review. 2012-06-04 11:06:45 -04:00
Barry Warsaw
c58c392da7 Trunk merge. 2012-06-04 09:41:48 -04:00