Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tarfile doesn't detect disk full error on extraction #51606

Closed
eliv mannequin opened this issue Nov 19, 2009 · 4 comments
Closed

tarfile doesn't detect disk full error on extraction #51606

eliv mannequin opened this issue Nov 19, 2009 · 4 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@eliv
Copy link
Mannequin

eliv mannequin commented Nov 19, 2009

BPO 7357
Nosy @gustaebel

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 = <Date 2009-12-13.11:50:06.741>
created_at = <Date 2009-11-19.15:21:20.332>
labels = ['type-bug', 'library']
title = "tarfile doesn't detect disk full error on extraction"
updated_at = <Date 2009-12-13.11:50:06.740>
user = 'https://bugs.python.org/eliv'

bugs.python.org fields:

activity = <Date 2009-12-13.11:50:06.740>
actor = 'lars.gustaebel'
assignee = 'lars.gustaebel'
closed = True
closed_date = <Date 2009-12-13.11:50:06.741>
closer = 'lars.gustaebel'
components = ['Library (Lib)']
creation = <Date 2009-11-19.15:21:20.332>
creator = 'eliv'
dependencies = []
files = []
hgrepos = []
issue_num = 7357
keywords = []
message_count = 4.0
messages = ['95481', '95489', '95550', '96330']
nosy_count = 2.0
nosy_names = ['lars.gustaebel', 'eliv']
pr_nums = []
priority = 'normal'
resolution = 'accepted'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue7357'
versions = ['Python 2.6']

@eliv
Copy link
Mannequin Author

eliv mannequin commented 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.

@eliv eliv mannequin added the stdlib Python modules in the Lib dir label Nov 19, 2009
@gustaebel
Copy link
Mannequin

gustaebel mannequin commented 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.

@gustaebel gustaebel mannequin self-assigned this Nov 19, 2009
@eliv
Copy link
Mannequin Author

eliv mannequin commented 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
Copy link
Mannequin

gustaebel mannequin commented 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.

@gustaebel gustaebel mannequin closed this as completed Dec 13, 2009
@gustaebel gustaebel mannequin added the type-bug An unexpected behavior, bug, or error label Dec 13, 2009
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

0 participants