mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	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).
This commit is contained in:
		
							parent
							
								
									94093ffcb6
								
							
						
					
					
						commit
						c3b6ac796f
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -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 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Walter Dörwald
						Walter Dörwald