diff options
author | Lars Gustäbel <lars@gustaebel.de> | 2009-12-13 11:42:29 (GMT) |
---|---|---|
committer | Lars Gustäbel <lars@gustaebel.de> | 2009-12-13 11:42:29 (GMT) |
commit | 365aff3a9c3e421097782e5220790ee9ef849f2c (patch) | |
tree | 0792730e8fa21e2741a662b3d69f76864f6e3281 | |
parent | 8f326b23695dc4996327da8477e11aad42c61953 (diff) | |
download | cpython-365aff3a9c3e421097782e5220790ee9ef849f2c.zip cpython-365aff3a9c3e421097782e5220790ee9ef849f2c.tar.gz cpython-365aff3a9c3e421097782e5220790ee9ef849f2c.tar.bz2 |
Merged revisions 76780 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76780 | lars.gustaebel | 2009-12-13 12:32:27 +0100 (Sun, 13 Dec 2009) | 21 lines
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.
........
-rw-r--r-- | Lib/tarfile.py | 2 | ||||
-rw-r--r-- | Misc/NEWS | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 55bb4e3..7a67e15 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1481,7 +1481,7 @@ class TarFile(object): ignore_zeros = False # If true, skips empty or invalid blocks and # continues processing. - errorlevel = 0 # If 0, fatal errors only appear in debug + errorlevel = 1 # If 0, fatal errors only appear in debug # messages (if debug >= 0). If > 0, errors # are passed to the caller as exceptions. @@ -157,6 +157,9 @@ C-API Library ------- +- Issue #7357: tarfile no longer suppresses fatal extraction errors by + default. + - Issue #5949: added check for correct lineends in input from IMAP server in imaplib. |