]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix #9923: mailcap now uses the OS path separator for the MAILCAP envvar. Not backpor...
authorNick Coghlan <ncoghlan@gmail.com>
Sat, 27 Aug 2011 14:17:31 +0000 (00:17 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Sat, 27 Aug 2011 14:17:31 +0000 (00:17 +1000)
Lib/mailcap.py
Misc/NEWS

index 4ae13d7ed7fb89bd93912aaee54ea47b8b18f699..99f4958bf70681abcce08839852b81aaacd13c8a 100644 (file)
@@ -33,10 +33,10 @@ def getcaps():
 
 def listmailcapfiles():
     """Return a list of all mailcap files found on the system."""
-    # XXX Actually, this is Unix-specific
+    # This is mostly a Unix thing, but we use the OS path separator anyway
     if 'MAILCAPS' in os.environ:
-        str = os.environ['MAILCAPS']
-        mailcaps = str.split(':')
+        pathstr = os.environ['MAILCAPS']
+        mailcaps = pathstr.split(os.pathsep)
     else:
         if 'HOME' in os.environ:
             home = os.environ['HOME']
index c0fa159adacc0f72caad9b2c2ce4a1c6db4c0e00..85dbe25876b22c0d31f98939f66b249fbe957db8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -268,6 +268,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #9923: The mailcap module now correctly uses the platform path
+  separator for the MAILCAP environment variable on non-POSIX platforms.
+
 - Issue #12835: Follow up to #6560 that unconditionally prevents use of the
   unencrypted sendmsg/recvmsg APIs on SSL wrapped sockets. Patch by David
   Watson.