Commit Graph

3490 Commits

Author SHA1 Message Date
Benjamin Peterson ddd392cbb9 accept None as the same as having passed no argument in file types #7349
This is for consistency with imitation file objects like StringIO and BytesIO.

This commit also adds a few tests, where they were lacking for concerned
methods.
2009-12-13 19:19:07 +00:00
Benjamin Peterson c4771d2fe1 add NEWS note 2009-12-13 17:31:31 +00:00
Benjamin Peterson 4895af4ef1 fix the ignoring of __cmp__ method on metaclasses #7491 2009-12-13 16:36:53 +00:00
Antoine Pitrou 2a08b42e95 Add NEWS entry as per RDM's suggestion (the bug was actually present
in 2.7 alpha 1)
2009-12-13 16:18:14 +00:00
Lars Gustäbel 92ca7561bb Issue #7357: No longer suppress fatal extraction errors by
default.

TarFile's errorlevel argument controls how errors are
handled that occur during extraction. There are three
possible levels 0, 1 and 2. If errorlevel is set to 1 or 2
fatal errors (e.g. a full filesystem) are raised as
exceptions. If it is set to 0, which is the default value,
extraction errors are suppressed, and error messages are
written to the debug log instead. But, if the debug log is
not activated, which is the default as well, all these
errors go unnoticed.

The original intention was to imitate GNU tar which tries
to extract as many members as possible instead of stopping
on the first error. It turns out that this is no good
default behaviour for a tar library. This patch simply
changes the default value for the errorlevel argument from
0 to 1, so that fatal extraction errors are raised as
EnvironmentError exceptions.
2009-12-13 11:32:27 +00:00
Mark Dickinson 9be87bc992 Issue #3366: Add lgamma function to math module. 2009-12-11 17:29:33 +00:00
Vinay Sajip 5cc4e2a040 Issue #7470: logging: fix bug in Unicode encoding fallback. 2009-12-11 09:16:01 +00:00
Raymond Hettinger a5fd24e97d Add a reverse() method to collections.deque(). 2009-12-10 06:42:54 +00:00
Raymond Hettinger 0b3263b073 Fix variants of deque.extend: d.extend(d) d+=d d.extendleft(d) 2009-12-10 06:00:33 +00:00
R. David Murray 93321f333c Issue 5949: fixed IMAP4_SSL hang when the IMAP server response is
missing proper end-of-line termination.  Patch and tests by
Scott Dial.  The new tests include a test harness which will
make it easier to add additional tests.
2009-12-09 15:15:31 +00:00
Antoine Pitrou 187177fc55 Issue #6986: Fix crash in the JSON C accelerator when called with the
wrong parameter types.  Patch by Victor Stinner.
2009-12-08 15:40:51 +00:00
Tarek Ziadé a939ecd95b Issue #7457: added a read_pkg_file method to distutils.dist.DistributionMetadata so we can read back PKG-INFO files 2009-12-08 08:56:49 +00:00
Vinay Sajip 4830566751 logging: Added optional 'secure' parameter to SMTPHandler. 2009-12-06 17:57:11 +00:00
Tarek Ziadé 4f38317d5a Fixed #1923: make sure we don't strip meaningful whitespace in PKG-INFO Description field 2009-12-06 09:22:40 +00:00
Benjamin Peterson 3513c87a21 fix date 2009-12-05 18:48:13 +00:00
Benjamin Peterson 4f51baf466 post release version bump 2009-12-05 18:40:02 +00:00
Benjamin Peterson d78cec5f39 bump version to 2.7a1 2009-12-05 17:47:56 +00:00
Mark Dickinson 2628590970 Add missing issue number in Misc/NEWS entry. 2009-12-04 11:30:16 +00:00
R. David Murray 820b0ea36c Issue 7431: use TESTFN in test_linecache instead of trying to create a
file in the Lib/test directory, which might be read-only for the
user running the tests.
2009-12-03 23:57:59 +00:00
Martin v. Löwis c218a2fac8 Issue #4120: Drop reference to CRT from manifest when building
extensions with msvc9compiler.
2009-12-03 20:53:51 +00:00
Benjamin Peterson 91c12ebc3d disable pymalloc tricks with the --with-valgrind option #2422
Patch from James Henstridge.
2009-12-03 02:52:39 +00:00
Antoine Pitrou 30b3b35cba Issue #7333: The `posix` module gains an `initgroups()` function providing
access to the initgroups(3) C library call on Unix systems which implement
it.  Patch by Jean-Paul Calderone.
2009-12-02 20:37:54 +00:00
Amaury Forgeot d'Arc d728871ee1 #7419: Fix a crash on Windows in locale.setlocale() when the category
is outside the allowed range.
2009-12-01 21:51:04 +00:00
Tarek Ziadé a5076a2543 Fixed #7408: dropped group ownership checking because it relies on os-specific rules 2009-11-29 22:20:30 +00:00
Eric Smith c4ab8339e9 Issue #3382: Make '%F' and float.__format__('F') convert results to upper case. Much of the patch came from Mark Dickinson. 2009-11-29 17:40:57 +00:00
Antoine Pitrou d16f57bf4d Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert Collins. 2009-11-28 15:55:58 +00:00
Vinay Sajip 01801d1f08 Issue #7403: Fixed possible race condition in lock creation. 2009-11-27 14:03:36 +00:00
Martin v. Löwis 50ea4565bd Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}. 2009-11-27 13:56:01 +00:00
Antoine Pitrou acbe3bdbab Issue #6845: Add restart support for binary upload in ftplib. The
`storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
argument.  Patch by Pablo Mouzo.

(note: the patch also adds a test for the rest argument in retrbinary())
2009-11-27 13:18:34 +00:00
Antoine Pitrou bcfaf8007d Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method returning
the total number of seconds in the duration.  Patch by Brian Quinlan.
2009-11-25 22:59:36 +00:00
Vinay Sajip c470d68d39 Issue #6615: logging: Used weak references in internal handler list. Thanks to flox (Florent Xicluna) for the patch. 2009-11-25 09:03:30 +00:00
Mark Dickinson 9dd5e16c5d Issue #7117, continued: Remove substitution of %g-style formatting for
%f-style formatting, which used to occur at high precision.  Float formatting
should now be consistent between 2.7 and 3.1.
2009-11-23 20:54:09 +00:00
Mark Dickinson 18cfada1ea Remove restriction on precision when formatting floats. This is the
first step towards removing the %f -> %g switch (see issues 7117,
5859).
2009-11-23 18:46:41 +00:00
Senthil Kumaran 5c456e6f45 Fix for issue1488943 - difflib.Differ() doesn't always add hints for tab
characters.
2009-11-23 18:41:31 +00:00
Lars Gustäbel dd866d57af Issue #6123: Fix opening empty archives and files.
(Note that an empty archive is not the same as an empty file. An
empty archive contains no members and is correctly terminated with an
EOF block full of zeros. An empty file contains no data at all.)

The problem was that although tarfile was able to create empty
archives, it failed to open them raising a ReadError. On the other
hand, tarfile opened empty files without error in most read modes and
presented them as empty archives. (However, some modes still raised
errors: "r|gz" raised ReadError, but "r:gz" worked, "r:bz2" even
raised EOFError.)

In order to get a more fine-grained control over the various internal
error conditions I now split up the HeaderError exception into a
number of meaningful sub-exceptions. This makes it easier in the
TarFile.next() method to react to the different conditions in the
correct way.

The visible change in its behaviour now is that tarfile will open
empty archives correctly and raise ReadError consistently for empty
files.
2009-11-22 18:30:53 +00:00
Benjamin Peterson 48f0a8df19 spelling 2009-11-19 23:19:29 +00:00
Benjamin Peterson 89b1a5ce18 add news notes for r76416 2009-11-19 22:58:01 +00:00
Mark Dickinson b678de8ba6 Misc/NEWS entries for issue 7117. 2009-11-19 18:41:49 +00:00
Ronald Oussoren 315cd0c739 Fix for issue #7085
On MacOSX 10.6 the CoreFoundation framework must be initialized on the main
thread, the constructor function in that framework will cause an SIGABRT when
it is called on any other thread.

Because a number of extension link (indirectly) to CoreFoundation and the
Python core itself didn't the interpreter crashed when importing some
extensions, such as _locale, on a secondary thread.

This fix ensures that Python is linked to CoreFoundation on OSX, which results
in the CoreFoundation constructor being called when Python is loaded. This
does not require code changes.
2009-11-19 16:25:21 +00:00
Tarek Ziadé 39de1fc5c8 dragfullwindows can have value 2 2009-11-19 05:33:16 +00:00
Benjamin Peterson dc3c239b1e #5037 proxy __unicode__ correctly 2009-11-19 03:00:02 +00:00
Lars Gustäbel 355538e5f5 Issue #7341: Close the internal file object in the TarFile
constructor in case of an error.
2009-11-18 20:24:54 +00:00
Mark Dickinson bd15a06fd3 Issue #7117, continued: Change round implementation to use the correctly-rounded
string <-> float conversions;  this makes sure that the result of the round
operation is correctly rounded, and hence displays nicely using the new float
repr.
2009-11-18 19:33:35 +00:00
Tarek Ziadé acccafcf70 #7293: distutils.test_msvc9compiler now uses a key that exists on any fresh windows install 2009-11-18 08:46:56 +00:00
Philip Jenvey fab8be2f99 #1757126: fix typo with the cyrillic_asian alias 2009-11-17 02:42:26 +00:00
Nick Coghlan 11db64e5fd Issue #7328: don't corrupt sys.path when running pydoc with the -m switch 2009-11-15 22:36:47 +00:00
Antoine Pitrou ccd5e02d2b Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using
TLS or SSL.  Patch by Giampaolo Rodola'.
2009-11-15 17:22:09 +00:00
Mark Dickinson 82864d1ab1 Issue #7228: Add '%lld' and '%llu' support to PyFormat_FromString,
PyFormat_FromStringV and PyErr_Format.
2009-11-15 16:18:58 +00:00
Antoine Pitrou d5b34d4597 Issue #4969: The mimetypes module now reads the MIME database from
the registry under Windows.  Patch by Gabriel Genellina.
2009-11-15 14:10:48 +00:00
Nick Coghlan 49868cb686 Issue #6816: expose the zipfile and directory execution mechanism to Python code via the runpy module. Also consolidated some script execution functionality in the test harness into a helper module and removed some implementation details from the runpy module documentation. 2009-11-15 07:30:34 +00:00