def _encode(text, encoding):
    try:
        return text.encode(encoding, "xmlcharrefreplace")
    except (__HOLE__, AttributeError):
        _raise_serialization_error(text)
dataset/ETHPy150Open kleientertainment/ds_mod_tools/pkg/win32/Python27/Lib/xml/etree/ElementTree.py/_encode