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.
Created on 2010年09月23日 03:03 by gnofi, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| mailcap_trunk.py | gnofi, 2010年09月23日 03:03 | trunk patch | ||
| mailcap_py3k.py | gnofi, 2010年09月23日 03:04 | py3k branch patch | ||
| Messages (10) | |||
|---|---|---|---|
| msg117163 - (view) | Author: Gregory Nofi (gnofi) | Date: 2010年09月23日 03:03 | |
mailcap.getcaps() has a call to mailcap.listmailcapfiles(), which returns a list of all mailcap files found on the system.
listmailcapfiles() first looks for the MAILCAPS environment variable. If it exists, it converts the string value into a list by splitting it on ":". This will not work on platforms that use other path separators, like Windows (";").
Attached are patches that use os.pathsep instead.
For more information about the MAILCAPS variable, see Appendix A in RFC 1524 (http://tools.ietf.org/html/rfc1524.html).
|
|||
| msg117164 - (view) | Author: Gregory Nofi (gnofi) | Date: 2010年09月23日 03:06 | |
Fixing typo in title |
|||
| msg117326 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2010年09月24日 19:15 | |
Thanks for the patches. Can you also add a test case to Lib/test/mailcap.py to cover this problem? |
|||
| msg117395 - (view) | Author: Gregory Nofi (gnofi) | Date: 2010年09月25日 22:38 | |
I'm also creating a test for mailcap (Issue 6484), which is how I found this bug. I'll have an update to that test submitted soon once I implement r.david.murray's helpful suggestions. |
|||
| msg117939 - (view) | Author: Gregory Nofi (gnofi) | Date: 2010年10月04日 01:44 | |
I just submitted new versions of test_mailcap.py in case 6484. |
|||
| msg135470 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年05月07日 15:29 | |
BTW, is there a real use case that lead you to open this report, or is it just theoretical? I’m not even sure mailcap is used on non-UNIX (and even there, I think it’s not used by recent tools). |
|||
| msg135557 - (view) | Author: Gregory Nofi (gnofi) | Date: 2011年05月09日 02:24 | |
It's just theoretical. A web search shows that a few Windows programs, like PC Pine, can use $MAILCAPS. But none of those tools look recent, like you said. |
|||
| msg135593 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年05月09日 14:40 | |
Okay. Nonetheless, splitting on os.sep doesn’t cost us anything and is IMO a good practice to follow. |
|||
| msg143067 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年08月27日 14:17 | |
New changeset 7b83d2c1aad9 by Nick Coghlan in branch 'default': Fix #9923: mailcap now uses the OS path separator for the MAILCAP envvar. Not backported, since it could break cases where people worked around the old POSIX-specific behaviour on non-POSIX platforms. http://hg.python.org/cpython/rev/7b83d2c1aad9 |
|||
| msg143069 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2011年08月27日 14:32 | |
As noted in the commit message, I didn't backport this, since it didn't seem worth risking breaking even the unlikely case that someone actually *was* using the MAILCAP environment variable on Windows. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:06 | admin | set | github: 54132 |
| 2011年08月27日 14:32:06 | ncoghlan | set | status: open -> closed versions: - Python 2.7, Python 3.2 messages: + msg143069 resolution: fixed stage: patch review -> resolved |
| 2011年08月27日 14:17:44 | python-dev | set | nosy:
+ python-dev messages: + msg143067 |
| 2011年08月23日 14:02:27 | ncoghlan | set | stage: test needed -> patch review versions: + Python 3.2, Python 3.3, - Python 3.1 |
| 2011年08月23日 14:01:41 | ncoghlan | set | assignee: ncoghlan nosy: + ncoghlan |
| 2011年05月09日 14:40:37 | eric.araujo | set | messages: + msg135593 |
| 2011年05月09日 02:24:29 | gnofi | set | messages: + msg135557 |
| 2011年05月07日 15:29:10 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg135470 |
| 2011年05月07日 15:27:49 | eric.araujo | set | dependencies: + No unit test for mailcap module |
| 2010年10月04日 01:44:58 | gnofi | set | messages: + msg117939 |
| 2010年09月25日 22:38:37 | gnofi | set | messages: + msg117395 |
| 2010年09月24日 19:15:28 | ned.deily | set | nosy:
+ ned.deily messages: + msg117326 stage: test needed |
| 2010年09月24日 15:05:27 | ronaldoussoren | set | assignee: ronaldoussoren -> (no value) components: - macOS nosy: - ronaldoussoren |
| 2010年09月23日 03:06:20 | gnofi | set | messages:
+ msg117164 title: mailcap module may will not work on non-POSIX platforms if MAILCAPS env variable is set -> mailcap module may not work on non-POSIX platforms if MAILCAPS env variable is set |
| 2010年09月23日 03:04:32 | gnofi | set | files: + mailcap_py3k.py |
| 2010年09月23日 03:03:55 | gnofi | create | |