]> granicus.if.org Git - python/commitdiff
(Merge 3.3) Issue #17429: platform.linux_distribution() now decodes files from
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 8 Dec 2013 23:04:09 +0000 (00:04 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 8 Dec 2013 23:04:09 +0000 (00:04 +0100)
the UTF-8 encoding with the surrogateescape error handler, instead of decoding
from the locale encoding in strict mode. It fixes the function on Fedora 19
which is probably the first major distribution release with a non-ASCII name.
Patch written by Toshio Kuratomi.

1  2 
Lib/platform.py
Misc/ACKS
Misc/NEWS

diff --cc Lib/platform.py
index c3c4b328e1109bf9e1201e875e734c9ec975c84b,030ef2a3a4b61232530f5127a0ada55ed4b5aebb..ddddff4eb92cefe69c5d5f9523c494afdab0dabb
@@@ -315,8 -319,8 +319,8 @@@ def linux_distribution(distname='', ver
  
      """
      try:
-         etc = os.listdir('/etc')
+         etc = os.listdir(_UNIXCONFDIR)
 -    except os.error:
 +    except OSError:
          # Probably not a Unix system
          return distname,version,id
      etc.sort()
diff --cc Misc/ACKS
Simple merge
diff --cc Misc/NEWS
index f81db69a3eaded002167beb4b796e358aec133c9,3596b4e1ad905b37c8a373f22aeedea5202478a9..351106f1e9446cd0a99c65afd2ab3f3f99ac6c03
+++ b/Misc/NEWS
@@@ -21,9 -18,12 +21,15 @@@ Core and Builtin
  Library
  -------
  
+ - Issue #17429: platform.linux_distribution() now decodes files from the UTF-8
+   encoding with the surrogateescape error handler, instead of decoding from the
+   locale encoding in strict mode. It fixes the function on Fedora 19 which is
+   probably the first major distribution release with a non-ASCII name. Patch
+   written by Toshio Kuratomi.
 +- Issue #19343: Expose FreeBSD-specific APIs in resource module.  Original
 +  patch by Koobs.
 +
  - Issue #19929: Call os.read with 32768 within subprocess.Popen.communicate
    rather than 4096 for efficiency.  A microbenchmark shows Linux and OS X
    both using ~50% less cpu time this way.