def ebOpened(err):
            """
            Called when failed to open the file for reading.

            For known errors, return the FTP error code.
            For all other, return a file not found error.
            """
            if isinstance(err.value, FTPCmdError):
                return (err.value.errorCode, '/'.join(newsegs))
            log.err(err, "Unexpected error received while opening file:")
            return (FILE_NOT_FOUND, '/'.join(newsegs))

            Called when failed to open the file for reading.

            For known errors, return the FTP error code.
            For all other, return a file not found error.
            
stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/ftp.py