It seems the problem is with updated python310-mechanize. If I install the previous version calibre works.