Changeset 70567 in vbox for trunk/src/VBox/ValidationKit/common/utils.py
- Timestamp:
- Jan 12, 2018 8:19:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/common/utils.py
r70566 r70567 373 373 return oFile; 374 374 375 def noxcptReadLink(sPath, sXcptRet ):375 def noxcptReadLink(sPath, sXcptRet, sEncoding = 'utf-8'): 376 376 """ 377 377 No exceptions os.readlink wrapper. … … 380 380 sRet = os.readlink(sPath); # pylint: disable=E1101 381 381 except: 382 sRet =sXcptRet;383 return sRet ;382 return sXcptRet; 383 return sRet.decode(sEncoding, 'ignore'); 384 384 385 385 def readFile(sFile, sMode = 'rb'): … … 392 392 return sRet; 393 393 394 def noxcptReadFile(sFile, sXcptRet, sMode = 'rb' ):394 def noxcptReadFile(sFile, sXcptRet, sMode = 'rb', sEncoding = 'utf-8'): 395 395 """ 396 396 No exceptions common.readFile wrapper. … … 400 400 except: 401 401 sRet = sXcptRet; 402 if sEncoding is not None: 403 sRet = sRet.decode(sEncoding, 'ignore'); 402 404 return sRet; 403 405
Note:
See TracChangeset
for help on using the changeset viewer.