From: Victor Stinner Date: Sun, 8 Dec 2013 23:04:09 +0000 (+0100) Subject: (Merge 3.3) Issue #17429: platform.linux_distribution() now decodes files from X-Git-Tag: v3.4.0b2~291 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0aba1a2663799a7e6a5582a0d8052df840889016;p=python (Merge 3.3) 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. --- 0aba1a2663799a7e6a5582a0d8052df840889016 diff --cc Lib/platform.py index c3c4b328e1,030ef2a3a4..ddddff4eb9 --- a/Lib/platform.py +++ b/Lib/platform.py @@@ -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/NEWS index f81db69a3e,3596b4e1ad..351106f1e9 --- a/Misc/NEWS +++ 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.