Mercurial > cpython-lru_cache-weakref
diff Lib/platform.py @ 41982:ef09cb011959
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).
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Thu, 07 Jun 2007 19:26:24 +0000 |
| parents | 99027c2b3fd2 |
| children | 229c28cb9afb |
line wrap: on
line diff
--- a/Lib/platform.py Thu Jun 07 18:41:59 2007 +0000 +++ b/Lib/platform.py Thu Jun 07 19:26:24 2007 +0000 @@ -145,12 +145,12 @@ # 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
