Commit Graph

6698 Commits

Author SHA1 Message Date
Georg Brandl db99dd0605 Small wording update from Larry. 2012-06-24 16:15:46 +02:00
Georg Brandl a1bc35f07f Improve hmac.compare_digest() docstring and documentation, courtesy of Larry H. 2012-06-24 16:07:33 +02:00
Stefan Krah 39e810eb6c Make the benchmark more fair for _decimal/decimal.py by setting context.prec
only once (float obviously doesn't set any context at all).
2012-06-24 14:10:49 +02:00
Georg Brandl f78755968a Whitespace cleanup. 2012-06-24 13:58:31 +02:00
Georg Brandl 9dcbfc353d Remove unused variable. 2012-06-24 13:55:35 +02:00
Georg Brandl 93b7d7e4b9 Fix a refleak in c82451eeb595. 2012-06-24 13:54:51 +02:00
Christian Heimes 6cea65555c Issue #15061: Re-implemented hmac.compare_digest() in C 2012-06-24 13:48:32 +02:00
Larry Hastings 605a62ddb1 Issue #15118: Change return value of os.uname() and os.times() from
plain tuples to immutable iterable objects with named attributes
(structseq objects).
2012-06-24 04:33:36 -07:00
Georg Brandl 306336bcda Closes #15161: add support for giving path as a fd for truncate() and pathconf(). 2012-06-24 12:55:33 +02:00
Stefan Krah 78f075636c Speed up _decimal by another 10-15% by caching the thread local context
that was last accessed. In the pi benchmark (64-bit platform, prec=9),
_decimal is now only 1.5x slower than float.
2012-06-24 12:20:03 +02:00
Larry Hastings d60cd4295c Issue #14815: Bugfix: the PyLong fed into the seed generator must be unsigned. 2012-06-24 02:52:21 -07:00
Larry Hastings 49c15d4a5f Issue #14815: Use Py_ssize_t instead of long for the object hash, to
preserve all 64 bits of hash on Win64.
2012-06-24 01:54:21 -07:00
Gregory P. Smith 990a5feba7 Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted.
IOError is no longer raised due to a read system call returning EINTR
from within these methods.
2012-06-24 00:23:47 -07:00
Gregory P. Smith 5135992164 Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted.
IOError is no longer raised due to a read system call returning EINTR
from within these methods.
2012-06-23 23:55:39 -07:00
Larry Hastings b698d8e7e9 Issue #15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"
parameter from os.remove / os.unlink.
Patch written by Georg Brandl.  (I'm really looking forward to George
getting commit privileges so I don't have to keep doing checkins on his
behalf.)
2012-06-23 16:55:07 -07:00
Antoine Pitrou 766a16efe7 Fix test_re failure under Windows. 2012-06-23 14:17:39 +02:00
Georg Brandl 5bb7aa986e Try to fix shutil.which() tests on Windows by fixing a typo introduced in 27f9c26fdd8b in posix_access(). 2012-06-23 12:48:40 +02:00
Charles-François Natali f8f5237b2f Remove useless test (flowinfo is unsigned). 2012-06-23 10:26:54 +02:00
Charles-François Natali 9b0c006eb0 Remove useless test (flowinfo is unsigned). 2012-06-23 10:17:05 +02:00
Larry Hastings dbbc0c8bb3 Issue #14626: Fix buildbot issue on OpenIndiana 3.x machines. (Hopefully.) 2012-06-22 19:50:21 -07:00
Larry Hastings 67cbf7bff9 Issue #14626: Fix buildbot issue on x86 Tiger 3.x. 2012-06-22 17:06:48 -07:00
Larry Hastings 9cf065cfdc Issue #14626: Large refactoring of functions / parameters in the os module.
Many functions now support "dir_fd" and "follow_symlinks" parameters;
some also support accepting an open file descriptor in place of of a path
string.  Added os.support_* collections as LBYL helpers.  Removed many
functions only previously seen in 3.3 alpha releases (often starting with
"f" or "l", or ending with "at").  Originally suggested by Serhiy Storchaka;
implemented by Larry Hastings.
2012-06-22 16:30:09 -07:00
Stefan Krah 3077ab8237 Whitespace. 2012-06-23 00:31:04 +02: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 f7338f65fb Add forgotten files for #14837. 2012-06-22 21:12:59 +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
Kristjan Valur Jonsson 69cf913ba1 Issue #15124: Optimize _thread.LockType deletion and acquisition when
not contested, similar to what _thread.RLock already has.
2012-06-22 18:40:02 +00:00
Alexander Belopolsky 878054e97b Fixed compiler warnings in datetime_astimezone() 2012-06-22 14:11:58 -04: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