[Python-Dev] standard library mimetypes module pathologically broken?
ncoghlan at gmail.com
Wed Aug 12 05:19:07 CEST 2009
Jacob Rus wrote:
> Well, I've had some patches up at http://bugs.python.org/issue6626 for
> over a week now, and my updated version should have identical
> semantics to the current module, just with the module's *actual*
> behavior clear to anyone reading the code, some serious edge-case bugs
> fixed, and a general performance improvement.
One thing that would definitely help promote the patch is if you could
figure out a way to test those edge cases in the mimetypes test suite.
Then the usual technique of "add new tests to test suite -> see errors
-> apply fixes to module -> errors go away" demonstrates clearly that
the bugs used to exist and ensures that they won't be reintroduced in
> I'd like to make some further changes, particularly in which types and
> extensions the module knows about, to bring it up to date, and ideally
> even to remove the dependency on an Apache install, but I'd like some
> discussion and advice about it.
I'd want someone more familiar with using MIME than I am (Barry maybe?)
to chime in before doing anything on that front.
> I have some other questions: How does one deprecate part of a standard
> library API? How can we alert users to the deprecation? When can the
> deprecated parts be removed?
warnings.warn and DeprecatingWarning is the way to go for that. The code
stays in for at least one release with the warning (in this case, 2.7
and 3.2) and can then be removed in the subsequent release.
> I don't want to just give up on this, because I put more than a day of
> time into it, and I really do think the previous code was of poorer
> quality than should be in the standard library: I don't want new
> Python users reading it and thinking that's just how things are done
> around here. But if no one looks at my patches, I'm not sure what more
> I can do.
I added myself to the nosy list for your patch precisely so I could look
at it, but the RAID array in the subversion server went down late last
week and won't be fixed for another day or two.
Otherwise I probably would have tried this out over the weekend :(
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev