It turned out not to be a Calibre problem
It turned out not to be a Calibre problem,
When I invoke python interpreter it can't open ANY existing file for writing if this file is located on NAS ( mounted with mount -t cifs). It can delete file, create new file and open existing file for reading, but not 'w' or 'wb' mode in open if file exists. It return error code 2, saying "No such file"