Minor refactoring

This commit is contained in:
Miroslav Stampar
2019-03-13 16:40:22 +01:00
parent eb62397c92
commit aecaa27839
4 changed files with 20 additions and 10 deletions

View File

@@ -1809,6 +1809,15 @@ def normalizePath(filepath):
return retVal
def safeFilepathEncode(filepath):
retVal = filepath
if filepath and isinstance(filepath, unicode):
retVal = filepath.encode(sys.getfilesystemencoding() or UNICODE_ENCODING)
return retVal
def safeExpandUser(filepath):
"""
Patch for a Python Issue18171 (http://bugs.python.org/issue18171)