From c3b6ac796f160ed27d2d1094ef606514ac3ae898 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Walter=20D=C3=B6rwald?= Date: Thu, 7 Jun 2007 19:26:24 +0000 Subject: [PATCH] Fix libc_ver(): libc_ver() was reading sys.executable in binary mode and comparing the content to strings, which failed. Now the bytes get decoded into unicode using latin-1 (the comparison compares ASCII strings only anyway, and we don't want the decoding to fail). --- Lib/platform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/platform.py b/Lib/platform.py index ed5d22dd97..bd9efe6f98 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -145,12 +145,12 @@ def libc_ver(executable=sys.executable,lib='',version='', # able to open symlinks for reading executable = os.path.realpath(executable) f = open(executable,'rb') - binary = f.read(chunksize) + binary = f.read(chunksize).decode('latin-1') pos = 0 while 1: m = _libc_search.search(binary,pos) if not m: - binary = f.read(chunksize) + binary = f.read(chunksize).decode('latin-1') if not binary: break pos = 0 -- 2.50.0