'Normal constructor for TorrentDef (The input, metainfo and infohash
parameters are used internally to make this a copy constructor)'

def __init__(self, input=None, metainfo=None, infohash=None):

    assert ((infohash is None) or isinstance(infohash, str)), ('INFOHASH    has    invalid    type:    %s' % type(infohash))
    assert ((infohash is None) or (len(infohash) == INFOHASH_LENGTH)), ('INFOHASH    has    invalid    length:    %d' % len(infohash))
    self._logger = logging.getLogger(self.__class__.__name__)
    if (input is not None):
        self.input = input
        self.metainfo = metainfo
        self.infohash = infohash
        return
    self.input = {}
    self.input.update(TDEF_DEFAULTS)
    self.input['encoding'] = sys.getfilesystemencoding()
    self.input['files'] = []
    self.metainfo_valid = False
    self.metainfo = None
    self.infohash = None
