You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tarfile doesn't detect disk full error on extraction #51606
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/gustaebel'closed_at=<Date2009-12-13.11:50:06.741>created_at=<Date2009-11-19.15:21:20.332>labels= ['type-bug', 'library']
title="tarfile doesn't detect disk full error on extraction"updated_at=<Date2009-12-13.11:50:06.740>user='https://bugs.python.org/eliv'
tarfile doesn't seem to return any error or raise any exception when an
extraction fills up the disk, making it hard to use safely. Both
extractall and extract suffer from this problem. I'm using CentOS 5.2
and python 2.6.2.
I quote: "If errorlevel is 0, all errors are ignored when using
TarFile.extract(). Nevertheless, they appear as error messages in the
debug output, when debugging is enabled. If 1, all fatal errors are
raised as OSError or IOError exceptions. If 2, all non-fatal errors are
raised as TarError exceptions as well."
Yes, thanks errorlevel works as expected, and errors are correctly
generated. It's quite unintuitive to ignore fatal errors by default
however.
gustaebel commented on Dec 13, 2009
gustaebelmannequin
Mannequin
More actions
I changed the default value for the errorlevel argument, so that fatal
errors are now raised as regular exceptions by default (trunk: r76780,
py3k: r76782). Thank you very much for bringing up this issue.
Activity
eliv commentedon Nov 19, 2009
tarfile doesn't seem to return any error or raise any exception when an
extraction fills up the disk, making it hard to use safely. Both
extractall and extract suffer from this problem. I'm using CentOS 5.2
and python 2.6.2.
gustaebel commentedon Nov 19, 2009
The TarFile constructor (as well as tarfile.open) takes an errorlevel
keyword argument. See
http://docs.python.org/dev/library/tarfile.html#tarfile-objects
I quote: "If errorlevel is 0, all errors are ignored when using
TarFile.extract(). Nevertheless, they appear as error messages in the
debug output, when debugging is enabled. If 1, all fatal errors are
raised as OSError or IOError exceptions. If 2, all non-fatal errors are
raised as TarError exceptions as well."
Hope that helps.
eliv commentedon Nov 20, 2009
Yes, thanks errorlevel works as expected, and errors are correctly
generated. It's quite unintuitive to ignore fatal errors by default
however.
gustaebel commentedon Dec 13, 2009
I changed the default value for the errorlevel argument, so that fatal
errors are now raised as regular exceptions by default (trunk: r76780,
py3k: r76782). Thank you very much for bringing up this issue.