[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-09-09 Thread R. David Murray
R. David Murray added the comment: Thanks, Michael. I didn't see anything that needed updating in the docs. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-09-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset f1bf0abcca0c by R David Murray in branch '3.5': #14977: Make mailcap respect the order of the lines in the mailcap file. https://hg.python.org/cpython/rev/f1bf0abcca0c New changeset efd692c86429 by R David Murray in branch 'default': Merge: #14977:

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-08-12 Thread Fabio Alessandro Locati
Fabio Alessandro Locati added the comment: Any news on this? -- nosy: +Fabio Alessandro Locati ___ Python tracker ___

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-14 Thread R. David Murray
R. David Murray added the comment: I think a doc update is probably worthwhile, but I haven't looked at the docs so I'm not sure. I'll try to give this a complete review this weekend, though I'm a bit busy so it may not happen. -- ___ Python

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-14 Thread Michael Lazar
Michael Lazar added the comment: Got it, I found some examples and it didn't look too complicated so I took a shot at it. Is there anything else that needs to be added? Does the documentation need to be updated at all? btw, thanks for the rapid iteration. I appreciate you taking the time to

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-13 Thread R. David Murray
R. David Murray added the comment: There's actually programmatic way to generate a deprecation warning when the function is called (and then we'd want a test to make sure it gets generated). if you don't feel like working through that hopefully someone else will pick it up. If you want to

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-13 Thread Michael Lazar
Changes by Michael Lazar : Added file: http://bugs.python.org/file43706/mailcap_v3.patch ___ Python tracker ___

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-13 Thread Michael Lazar
Michael Lazar added the comment: Whoops -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-13 Thread R. David Murray
R. David Murray added the comment: Looks like you didn't attach the new patch. -- ___ Python tracker ___ ___

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-13 Thread Michael Lazar
Michael Lazar added the comment: That works for me, patch updated to match your suggestion. So to recap, the proposed fix implements the following changes to the api: getcaps() The returned dict now has an additional `lineno` field. There's a *slim* chance that this could break behavior

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-12 Thread R. David Murray
R. David Murray added the comment: How about this: rename the existing readmailcapfile as an internal _readmailcapfile with the new signature. Then add a backward compatible readmailcapfile with the existing signature/return value that uses a dummy value for lineno and throws away the lineno

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-12 Thread Michael Lazar
Michael Lazar added the comment: I can certainly do that. Although in addition to adding a keyword argument, we would also have to change the return signature to switch between modes like this: if lineno is None: return caps else: return caps, lineno Overall I'm not a

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-12 Thread R. David Murray
R. David Murray added the comment: I think we need to preserve backward compatibility in the readmailcapfile function even though it isn't technically a public API (make lineno a keyword argument and the behavior dependent on its presence). I haven't experimented with the patch yet, but it

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-11 Thread Michael Lazar
Michael Lazar added the comment: Submitting an updated patch; simplified the implementation and updated test_mailcap.py -- Added file: http://bugs.python.org/file43695/mailcap_v2.patch ___ Python tracker

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-10 Thread Michael Lazar
Michael Lazar added the comment: Alright thanks, I've submitted a patch -- ___ Python tracker ___ ___

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-10 Thread Michael Lazar
Changes by Michael Lazar : -- keywords: +patch Added file: http://bugs.python.org/file43682/mailcap.patch ___ Python tracker

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-10 Thread R. David Murray
R. David Murray added the comment: Submit it as a proposed patch here for review, please. git or hg diff against the default branch, or a pointer to an hg clone with the patch applied. -- versions: +Python 3.5, Python 3.6 -Python 2.7, Python 3.2, Python 3.3

[issue14977] mailcap does not respect precedence in the presence of wildcards

2016-07-10 Thread Michael Lazar
Michael Lazar added the comment: Hello. In my opinion this is a pretty major deficiency. I was trying to add definitions to my ~/.mailcap file (which should take priority over system mailcap files) but they weren't getting applied because of the wildcard bug. This was prohibiting me from

[issue14977] mailcap does not respect precedence in the presence of wildcards

2012-08-17 Thread Petri Lehtinen
Petri Lehtinen added the comment: 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.

[issue14977] mailcap does not respect precedence in the presence of wildcards

2012-08-17 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- keywords: -easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14977 ___ ___ Python-bugs-list

[issue14977] mailcap does not respect precedence in the presence of wildcards

2012-06-01 Thread Emmanuel Beffara
New submission from Emmanuel Beffara m...@beffara.org: According to RFC 1542, the first matching entry in mailcap files should be used for handling a given type. The mailcap module does not respect this rule when wildcards are used in some rules, because the lookup function always checks

[issue14977] mailcap does not respect precedence in the presence of wildcards

2012-06-01 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Hmm. It seems to me this is an edge case as far as backward compatibility goes. On the one hand it does seem like an RFC violation (ie: bug), on the other hand there could be user programs depending on the current behavior. I'm