classification
Title: Rename BadZipfile to BadZipFile for consistency
Type: enhancement Stage: patch review
Components: Interpreter Core Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Retro, eric.araujo, ezio.melotti, georg.brandl, ixokai, pitrou
Priority: low Keywords: patch

Created on 2009-11-18 19:12 by Retro, last changed 2010-10-28 14:14 by eric.araujo. This issue is now closed.

Files
File name Uploaded Description Edit
zipfile-patch.diff Retro, 2009-11-19 17:48
issue7351-complete.patch ixokai, 2010-10-28 01:04
Messages (25)
msg95442 - (view) Author: Boštjan Mejak (Retro) Date: 2009-11-18 19:12
There are some minor typos in the docs. The section zipfile has twp typos:

exception zipfile.BadZipfile
    The error raised for bad ZIP files (old name: zipfile.error).

this should be

exception zipfile.BadZipFile
    The error raised for bad ZIP files (old name: zipfile.error).

Note: There needs to be a capital F in the exception class name BadZipFile.


There's also a typo in the sentence "Decryption is extremely slow as it
is implemented in native python rather than C." which should be
"Decryption is extremely slow as it is implemented in native Python
rather than C." This sentence is found just above the previous
BadZipfile typo.

Note: The word 'python' is needed to be capitalized.


These typos exist since the creation of the zipfile docs. Please correct
the docs for the selected versions. Thank you.
msg95445 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-11-18 19:40
BadZipfile is actually the correct name of the exception.

Fixed the other nit in r76376.
msg95453 - (view) Author: Boštjan Mejak (Retro) Date: 2009-11-18 20:54
Thanks for upcassing 'Python'.

I have to ask you why are all other classes named in the form of
...ZipFile, like
- exception: LargeZipFile
- class: ZipFile
- class: PyZipFile

Please at least consider of making the class BadZipfile consistent to
other classes and let it be renamed to BadZipFile. Thank you again.
msg95473 - (view) Author: Boštjan Mejak (Retro) Date: 2009-11-19 14:23
I suggest renaming the class from BadZipfile to BadZipFile. We have a
class named LargeZipFile. It would make sence to have the previously
mentioned class named as BadZipFile then. What is your verdict on that?
msg95477 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-11-19 14:41
The old name could be deprecated and replaced by the right one, but as
Eric Smith mentioned on #python-dev, the class with the old name can't
be removed because - even if unlikely - the object might exist in a pickle.
So we can either live with the wrong name or deprecate it, fix the
places where it's used and live with a deprecated version that can't be
removed.
msg95485 - (view) Author: Boštjan Mejak (Retro) Date: 2009-11-19 16:09
I am merely speaking of renaming the class name from BadZipfile to
BadZipFile. 

class BadZipFile(exceptions.Exception):
    # etc.


Only the name is fixed at class definition. I am aiming for that in this
bug report. And then every other BadZipfile should be fixed to
BadZipFile. Is that doable?
msg95488 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-11-19 16:24
It might be doable for Python and its stdlib, but all the programs and
modules that are using the old name will start raising errors if they
don't find the old name anymore.
If the old name is deprecated for at least one Python version (e.g.
2.7/3.2), these programs can fix it and then, after a few versions (e.g.
3.3), the old name can finally be removed.
There is still the pickle issue, even if IMHO it's so unlikely that it
shouldn't be relevant.
msg95505 - (view) Author: Boštjan Mejak (Retro) Date: 2009-11-19 17:48
I made a patch which fixes the BadZipfile issue. Please take a look and
decide whether you'll toss it or use it. Maybe it'll come handy some
other time in the future.
msg96690 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2009-12-20 15:41
Your patch need to include an alias (BadZipfile = BadZipFile) to
preserve compatibility with old pickles, as explains msg95477.

Cheers
msg96691 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-12-20 15:42
While the mismatched casing is unfortunate, I don't think changing it
for the sake of aesthetics is a good deal given that many existing
programs will have to be converted to the new spelling.
msg100182 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-02-27 11:39
Unless we are going to add an alias for BadZipfile, I'll close this as won't fix.
msg119730 - (view) Author: Boštjan Mejak (Retro) Date: 2010-10-27 20:16
I'm reopening this and I am making it a feature request for Python 3.2
msg119734 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-10-27 20:43
Boštjan, you need to update your patch to add the missing alias to the old name, as well as docs and test updates.

I’m +0 on the change.
msg119744 - (view) Author: Boštjan Mejak (Retro) Date: 2010-10-27 23:57
I am -1 for the alias. I want that this gets renamed in Python 3.2, not
aliased. I don't care about old pickles. Anyway, who has BadZipfile object
pickled? Just incorporate my patch and fix the docs and any test
cases/units. Thanks.

On Wed, Oct 27, 2010 at 10:43 PM, Éric Araujo <report@bugs.python.org>wrote:

>
> Éric Araujo <merwok@netwok.org> added the comment:
>
> Boštjan, you need to update your patch to add the missing alias to the old
> name, as well as docs and test updates.
>
> I’m +0 on the change.
>
> ----------
> stage: committed/rejected -> patch review
> title: Documentation typos found in "zipfile — Work with ZIP archives" ->
> Rename BadZipfile to BadZipFile for consistency
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue7351>
> _______________________________________
>
msg119745 - (view) Author: Stephen Hansen (ixokai) (Python triager) Date: 2010-10-28 00:11
You may "not care" about backwards compatibility, but introducing a breaking change in 3.2 for mere style-conformity is not OK, IMO. If the patcher insists on it being a breaking change, it should be rejected.

FWIW, this casing is sufficiently bizarre and inconsistent in the module itself, that it seems clearly wrong and likely to produce difficulties for people using it-- so although I'm not upgrading to Python3 anytime soon, I'd really like to change my code to be BadZipFile when I do, so I'd be +1 with an alias. :)
msg119746 - (view) Author: Boštjan Mejak (Retro) Date: 2010-10-28 00:29
No alias. Be stubborn and let the stdlib die in inconsistency.

On Thu, Oct 28, 2010 at 2:11 AM, Stephen Hansen <report@bugs.python.org>wrote:

>
> Stephen Hansen <me+python@ixokai.io <me%2Bpython@ixokai.io>> added the
> comment:
>
> You may "not care" about backwards compatibility, but introducing a
> breaking change in 3.2 for mere style-conformity is not OK, IMO. If the
> patcher insists on it being a breaking change, it should be rejected.
>
> FWIW, this casing is sufficiently bizarre and inconsistent in the module
> itself, that it seems clearly wrong and likely to produce difficulties for
> people using it-- so although I'm not upgrading to Python3 anytime soon, I'd
> really like to change my code to be BadZipFile when I do, so I'd be +1 with
> an alias. :)
>
> ----------
> nosy: +ixokai
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue7351>
> _______________________________________
>
msg119747 - (view) Author: Stephen Hansen (ixokai) (Python triager) Date: 2010-10-28 01:04
Considering I do use zipfiles a lot, I slightly care about this (at least, eventually)-- I'm attaching a new patch, with doc and test changes as well (and the compatibility alias).

What convinced me was looking at test_zipfile, and noticing how often it actually confused the issue in comments at least, between typing BadZipfile and BadZipFile.

Dunno if I worded the doc-change well, so you may want to adjust that.
msg119748 - (view) Author: Stephen Hansen (ixokai) (Python triager) Date: 2010-10-28 01:06
Oh: and I tested it against branches/py3k in the head, it applies cleanly and builds, and test_zipfile runs without error.
msg119758 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-28 06:42
Applied after review in r85874. (Please make sure your patches don't have trailing whitespace.)
msg119780 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-10-28 13:50
A “BadZipZile” in the patch made it to Subversion :)  Fixed in r85891.
msg119782 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-28 13:57
Thanks for the catch!
msg119783 - (view) Author: Boštjan Mejak (Retro) Date: 2010-10-28 14:00
Is the trailing whitespace problem solved? Please make sure everything is
correct and that no more typos occur for this issue. And I am the original
patch author, so mention my name (Boštjan Mejak) in the NEWS file. Thanks.

On Thu, Oct 28, 2010 at 8:42 AM, Georg Brandl <report@bugs.python.org>wrote:

>
> Georg Brandl <georg@python.org> added the comment:
>
> Applied after review in r85874. (Please make sure your patches don't have
> trailing whitespace.)
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue7351>
> _______________________________________
>
msg119784 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-28 14:05
a) I already removed the whitespace before committing.  The pre-commit hook wouldn't even allow committing that.

b) I don't think constant refusal to submit a patch in the way we request earns you a place in the acknowledgements.
msg119785 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-10-28 14:05
> Is the trailing whitespace problem solved?
You can follow the link to the revision to see that it is.  Georg’s message implied this, too.

> Please make sure everything is correct and that no more typos occur for this issue.
We do.

> And I am the original patch author, so mention my name (Boštjan Mejak) in the NEWS file. Thanks.
We don’t add names for very small patches like this one.

(P.S. Would you be so kind as to follow some netiquette in the tracker?  HTML email creates noisy unnamed attachments, and top-posting is redundant and hard to read.  Thanks in advance.)
msg119787 - (view) Author: Boštjan Mejak (Retro) Date: 2010-10-28 14:11
Then disable the tracker's ability to post messages via POP/IMAP. Just block
those protocols in the tracker and you won't see any gibberish anymore. ;)

On Thu, Oct 28, 2010 at 4:05 PM, Éric Araujo <report@bugs.python.org> wrote:

>
> Éric Araujo <merwok@netwok.org> added the comment:
>
> > Is the trailing whitespace problem solved?
> You can follow the link to the revision to see that it is.  Georg’s message
> implied this, too.
>
> > Please make sure everything is correct and that no more typos occur for
> this issue.
> We do.
>
> > And I am the original patch author, so mention my name (Boštjan Mejak) in
> the NEWS file. Thanks.
> We don’t add names for very small patches like this one.
>
> (P.S. Would you be so kind as to follow some netiquette in the tracker?
>  HTML email creates noisy unnamed attachments, and top-posting is redundant
> and hard to read.  Thanks in advance.)
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue7351>
> _______________________________________
>
History
Date User Action Args
2010-10-28 14:14:18eric.araujosetfiles: - unnamed
2010-10-28 14:11:46Retrosetfiles: + unnamed

messages: + msg119787
2010-10-28 14:05:57eric.araujosetmessages: + msg119785
2010-10-28 14:05:46georg.brandlsetmessages: + msg119784
2010-10-28 14:02:58eric.araujosetfiles: - unnamed
2010-10-28 14:02:54eric.araujosetfiles: - unnamed
2010-10-28 14:00:06Retrosetfiles: + unnamed

messages: + msg119783
2010-10-28 13:57:07georg.brandlsetmessages: + msg119782
2010-10-28 13:50:20eric.araujosetmessages: + msg119780
2010-10-28 06:42:46georg.brandlsetmessages: + msg119758
2010-10-28 06:42:39georg.brandlsetmessages: - msg119757
2010-10-28 06:39:44georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg119757
2010-10-28 01:06:34ixokaisetmessages: + msg119748
2010-10-28 01:04:44ixokaisetfiles: + issue7351-complete.patch

messages: + msg119747
2010-10-28 00:29:52Retrosetfiles: + unnamed

messages: + msg119746
2010-10-28 00:11:41ixokaisetnosy: + ixokai
messages: + msg119745
2010-10-27 23:58:21Retrosetfiles: - unnamed
2010-10-27 23:57:28Retrosetfiles: + unnamed

messages: + msg119744
2010-10-27 20:43:26eric.araujosettitle: Documentation typos found in "zipfile — Work with ZIP archives" -> Rename BadZipfile to BadZipFile for consistency
messages: + msg119734
stage: resolved -> patch review
2010-10-27 20:33:33georg.brandlsetassignee: georg.brandl ->
2010-10-27 20:16:32Retrosetstatus: closed -> open

type: enhancement
components: + Interpreter Core, - Documentation
versions: - Python 2.6, Python 3.1, Python 2.7
nosy: georg.brandl, pitrou, ezio.melotti, eric.araujo, Retro
messages: + msg119730
resolution: wont fix -> (no value)
2010-08-10 15:12:28eric.araujosetresolution: fixed -> wont fix
stage: resolved
2010-08-10 15:06:12georg.brandlsetstatus: pending -> closed
2010-02-27 11:39:12ezio.melottisetstatus: open -> pending

messages: + msg100182
2009-12-20 15:42:18pitrousetnosy: + pitrou
messages: + msg96691
2009-12-20 15:41:34eric.araujosetnosy: + eric.araujo
messages: + msg96690
2009-11-19 17:48:22Retrosetfiles: + zipfile-patch.diff
keywords: + patch
messages: + msg95505
2009-11-19 16:24:01ezio.melottisetmessages: + msg95488
2009-11-19 16:09:51Retrosetmessages: + msg95485
2009-11-19 14:41:26ezio.melottisetpriority: low
nosy: + ezio.melotti
messages: + msg95477

2009-11-19 14:23:00Retrosetmessages: + msg95473
2009-11-18 20:54:52Retrosetstatus: closed -> open

messages: + msg95453
2009-11-18 19:40:06georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg95445
2009-11-18 19:12:34Retrocreate