This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author petri.lehtinen
Recipients barry, manu-beffara, petri.lehtinen, r.david.murray
Date 2012-08-17.10:21:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1345198865.41.0.487135704267.issue14977@psf.upfronthosting.co.za>
In-reply-to
Content
Sounds like a bug to me.

It's not too straightforward to fix, though. The order of MIME types is lost because they are stored as keys of a dict. AFAICS, it wouldn't help to use OrderedDict and checking for the wildcard type first if its index is smaller. Example:

image/*; foo %s; test=/bin/false
image/jpeg; bar %s; test=/bin/true
image/*; baz %s; test=/bin/true

In this case, the image/jpeg entry should be returned, but both image/* entries get grouped together, so they would be evaluated first and the "baz %s" entry would be returned.

The API expects the result of getcaps() (a dict) to be passed to findmatch(), which makes it very hard to change the caps representation. The only way I can think of would be to change the representation to a dict subclass with extra semantics. Plain dict would still have to be supported for backwards compatibility, though.
History
Date User Action Args
2012-08-17 10:21:05petri.lehtinensetrecipients: + petri.lehtinen, barry, r.david.murray, manu-beffara
2012-08-17 10:21:05petri.lehtinensetmessageid: <1345198865.41.0.487135704267.issue14977@psf.upfronthosting.co.za>
2012-08-17 10:21:04petri.lehtinenlinkissue14977 messages
2012-08-17 10:21:03petri.lehtinencreate