[New-bugs-announce] [issue14012] Misc tarfile fixes

Éric Araujo report at bugs.python.org
Tue Feb 14 17:10:37 CET 2012


New submission from Éric Araujo <merwok at netwok.org>:

I found a few possible bugs in tarfile:

- “mode in 'raw'” can give false positives for '' or 'ra'.  Most of the code also checks for “len(mode) > 1”, but I find clearer and safer to just use “mode in ('r', 'a', 'w')”.

- To use the shadowed builtin “open”, tarfile uses both “import as” and a local alias “bltin_open = open”.  However, the second idiom would break if tarfile were reloaded.

- Error messages don’t say what the invalid mode was.  (Error messages are not part of the language, but nonetheless maybe it’s best not to commit that to stable branches.)

----------
components: Library (Lib)
files: tarfile-misc-bugs-3.2.diff
keywords: patch
messages: 153348
nosy: eric.araujo, lars.gustaebel
priority: normal
severity: normal
stage: commit review
status: open
title: Misc tarfile fixes
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24520/tarfile-misc-bugs-3.2.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14012>
_______________________________________


More information about the New-bugs-announce mailing list