def extract_shebang_command(handle):
    """
    Extract the shebang_ command line from an executable script.

    :param handle: A file-like object (assumed to contain an executable).
    :returns: The command in the shebang_ line (a string).

    The seek position is expected to be at the start of the file and will be
    reset afterwards, before this function returns. It is not an error if the
    executable contains binary data.

    .. _shebang: https://en.wikipedia.org/wiki/Shebang_(Unix)
    """
    try:
        if handle.read(2) == b'#!':
            data = handle.readline()
            text = data.decode('UTF-8')
            return text.strip()
        else:
            return ''
    finally:
        handle.seek(0)