Calibre error on Ubuntu 20.04 - fix.
January 14, 2021•209 words
Here is the source blog post. I have copied the text below almost word for word and added some formatting for my own viewing. All credit to the original blog post author.
open a terminal and issue the following
calibre
If we get the error below we need to edit a file – "server.py" to fix that.
AttributeError: 'NoneType' object has no attribute 'cancel'
Head to the directory, using cd command-line utility, where our server.py is stored.
cd /usr/lib/calibre/calibre/utils/ipc/
open the file server.py using a text-editor.
sudo vim server.py
We need to the edit the code from Line 110. So, it goes like this
#self._listener._unlink.cancel() if self._listener._unlink is not None: self._listener._unlink.cancel()
We have put a hash before the original code and subsequently appended the file with an "if" statement.
Try running calibre again in terminal. It should now launch the application.
In certain circumstances it may still throw an indentation error.
if self._listener._unlink is not None: ^ TabError: inconsistent use of tabs and spaces in indentation
If so, use proper tabs and spaces at the beginning of the "self.listener.unlink.cancel()" code. It should resolve the issue.
#calibre #fix #ubuntu