

def _make_text_safeish(text, fallback_encoding, method='decode'):
    try:
        unitext = getattr(text, method)('utf-8')
    except (UnicodeEncodeError, UnicodeDecodeError):
        unitext = getattr(method, method)(fallback_encoding)
    except AttributeError:
        unitext = str(text)
    return unitext

dataset/ETHPy150Open JT5D/Alfred-Popclip-Sublime/Sublime Text 2/sublime-github/lib/git.py _make_text_safeish/VarMisuse@46/69 `text`->`method`