Commit Graph

6670 Commits

Author SHA1 Message Date
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
Alexander Belopolsky 31227ca514 Issue #9527: Fixes for platforms without tm_zone 2012-06-22 13:23:21 -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
Larry Hastings 8f904daee9 Issue #14769: test_capi now has SkipitemTest, which cleverly checks
for "parity" between PyArg_ParseTuple() and the Python/getargs.c static
function skipitem() for all possible "format units".
2012-06-22 03:56:29 -07:00
Hynek Schlawack 7f59fd7c7c Simplify code in fileio_init
If an identical code line is in both at the end of if and else, it can as well
stand after the block. :) The code is from 464cf523485e, I didn't see it before
checking the commits in the web interface of course.
2012-06-22 09:32:22 +02: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 cf5e1d82e3 Tidy up comments from dd4f7d5c51c7 (zlib compression dictionary support). 2012-06-22 00:35:57 +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
Hynek Schlawack 69168354c2 #10053: Don't close FDs when FileIO.__init__ fails
Loosely based on the work by Hirokazu Yamamoto.
2012-06-21 20:58:31 +02:00
Hynek Schlawack 9ed8b4e4ca #10053: Don't close FDs when FileIO.__init__ fails
Loosely based on the work by Hirokazu Yamamoto.
2012-06-21 20:20:25 +02:00
doko@ubuntu.com c2b4673ffe md5_{init,process,done}: make static 2012-06-21 17:26:06 +02:00
doko@ubuntu.com 1e5be8cfb5 sha1_{init,process,done}: make static 2012-06-21 17:05:50 +02:00
doko@ubuntu.com 1e3398a50c ... and fix the name of the sha1 file name. 2012-06-21 16:22:15 +02:00
doko@ubuntu.com dca7303ff5 Fix name of the sha1 extension. 2012-06-21 16:00:52 +02:00
doko@ubuntu.com 0684a9d146 Remove references to removed md5.h and md5.c files. 2012-06-21 12:13:35 +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
Stefan Krah 50b0a365ba Fix comment. 2012-06-20 23:38:51 +02:00
Stefan Krah 22385011ed Many cleanups of redundant code in mpd_qrem_near():
1) _mpd_qdivmod() uses the context precision only in two places, and
     the new code should be exactly equivalent to the previous code.

  2) Remove misleading comment.

  3) The quotient *is* an integer with exponent 0, so calling mpd_qtrunc()
     is pointless.

  4) Replace two instances of identical code by a single one.

  5) Use _mpd_cmp_abs() instead of mpd_cmp_total_mag(): the operands
     are not special.

  6) Don't clear MPD_Rounded in the status (with the current code it should
     not be set within the function).
2012-06-20 23:34:58 +02:00
Antoine Pitrou e67f48ce5e Issue #14928: Fix importlib bootstrap issues by using a custom executable (Modules/_freeze_importlib) to build Python/importlib.h. 2012-06-19 22:29:35 +02:00
Stefan Krah 9c1feb88f3 Add comments to the power functions, in particular to _mpd_qpow_real(). 2012-06-18 19:57:23 +02:00
Martin v. Löwis bce166681c Issue #14055: Add __sizeof__ support to _elementtree. 2012-06-17 10:41:22 +02:00
Stefan Krah c62bd13cb2 1) State the relative errors of the power functions for integer exponents.
2) _mpd_qpow_mpd(): Abort the loop for all specials, not only infinity.

3) _mpd_qpow_mpd(): Make the function more general and distinguish between
   zero clamping and folding down the exponent. The latter case is currently
   handled by setting context->clamp to 0 before calling the function.

4) _mpd_qpow_int(): Add one to the work precision in case of a negative
   exponent. This is to get the same relative error (0.1 * 10**-prec)
   for both positive and negative exponents. The previous relative
   error for negative exponents was (0.2 * 10**-prec).

   Both errors are _before_ the final rounding to the context precision.
2012-06-16 19:45:35 +02: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
Eli Bendersky 113da64259 Fix windows compilation problems caused by previous commit. 2012-06-15 07:52:49 +03:00
Eli Bendersky 64d11e60f2 Replace the iter/itertext methods of Element in _elementtree with true C implementations, instead of the bootstrapped Python code. In addition to being cleaner (removing the last remains of the bootstrapping code in _elementtree), this gives a 10x performance boost for iter() on large documents.
Also reorganized the tests a bit to be more robust.
2012-06-15 07:42:50 +03:00
Martin v. Löwis bc07cb883e Issue #14936: curses_panel was converted to PEP 3121 and PEP 384 API.
Patch by Robin Schreiber.
2012-06-14 16:01:23 +02:00
Martin v. Löwis c838ec1f82 Issue #14936: curses_panel was converted to PEP 3121 API.
Patch by Robin Schreiber.
2012-06-14 16:00:24 +02: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
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
Alexander Belopolsky d9738242f8 Fixed a typo in time_localtime() 2012-06-12 16:14:17 -04:00
Stefan Krah b7832939c7 1) Fix signature of _mpd_qpow_uint(): contrary to the comment base is constant.
2) Abort the loop for all specials, not only infinity.

3) Make the function more general and distinguish between zero clamping
   and folding down the exponent. The latter case is currently handled
   by setting context->clamp to 0 before calling the function.
2012-06-12 21:06:06 +02:00
Richard Oudkerk 197651b4e3 Issue #10133: Make multiprocessing deallocate buffer if socket read fails.
Patch by Hallvard B Furuseth.
2012-06-11 15:12:12 +01:00
Stefan Krah 88e19779ad 1) Replace long-winded abort() construct by assert().
2) Remove micro optimization (inline checking for NaN before calling
   mpd_qcheck_nans()) that probably has no benefit in this case.
2012-06-11 08:57:17 +02:00
Stefan Krah 9253862f45 1) State restrictions for the transform length.
2) Switch argument order to match the function signature of mpd_calloc()
   (cosmetic change, since the order is irrelevant).
2012-06-10 16:50:55 +02:00
Stefan Krah afc0c77b42 Add one extra comparison to the _mpd_shortmul() case to avoid repetitive code. 2012-06-09 15:28:36 +02:00
Stefan Krah 5248a2d3c1 Enumerate all cases in the overflow detection strategy in mpd_qlog10(). 2012-06-09 00:01:28 +02:00
Stefan Krah 0bf506cca5 Merge. 2012-06-08 18:55:22 +02:00
Stefan Krah 1cf6dfc8b2 1) List relative error for _mpd_qln10().
2) Add rigorous error analysis to _mpd_qlog10 (ACL2 proofs exist).

3) Use the relative error as a basis for the interval generation in the
   correction loop (same as in _mpd_qln()).
2012-06-08 18:41:33 +02:00
Alexander Belopolsky a4415141da Issue #2736: Added datetime.timestamp() method. 2012-06-08 12:33:09 -04:00
Stefan Krah 7bda265662 1) The overflow detection in mpd_qln() has a surprising number of case splits.
List all of them in the comment.

2) Use the recently stated relative error of _mpd_qln() to generate the
   interval for the exact value of ln(x). See also the comment in mpd_qexp().
2012-06-07 17:48:47 +02:00
Stefan Krah a3394bce33 1) Add error analysis comments to mpd_qln10() and _mpd_qln().
2) Simplify the precision adjustment code for values in [0.900, 1.15].
2012-06-06 15:57:18 +02:00
Gregory P. Smith 902274e948 Fixes issue #15000: support the odd x32 abi on posixsubprocess's system call. 2012-06-05 13:30:24 -07:00
Gregory P. Smith 58f07a9d6d Fixes issue #15000: support the odd x32 abi on posixsubprocess's system call. 2012-06-05 13:26:39 -07: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
Eli Bendersky c68e1368b5 Fix unterminated keyword array passed to PyArg_ParseTupleAndKeywords 2012-06-03 06:09:42 +03:00
Stefan Krah 67ee1d05dd word.digits are always initialized before use in the Taylor series loop,
but this is more readable.
2012-06-01 10:58:16 +02: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