Running Calibre on Snow Leopard
Yesterday I installed Snow Leopard on my recently bought MacBook. After installation I wanted to run Calibre (an eBook management application) because I wanted to download an eBook to my iPhone. Unfortunately Calibre completely went haywire. It was consuming about 100% CPU time, and the machine got almost completely unresponsive.I looked in the console messages and it contained a flurry of error messages. The Console application eventually refused to display them as it reported more than 500 messages per second. This was the message:
20/10/2009 23:55:40 [0x0-0x8f08f].net.kovidgoyal.calibre[6733] Qt: internal: -108: Error ATSUMeasureTextImage text/qfontengine_mac.mm: 1097
I googled to see if this was a known problem. First I found some messages stating that Calibre was incompatible with Snow Leopard, but these were more than a month old. In the meantime a new version had been released which I had installed. The changelog stated that it should run on Snow Leopard. I found a message of somebody that tried Calibre in a fresh user account which helped. So I also tried that and it worked. Therefore I also tried removing the Calibre preferences but that did not help. Next message I found was about somebody who had a bad font and removing it helped. I moved away all my fonts (in my home directory) but that did not help.
So I started looking for a more general explanation of that error message. I found that it could be an error in Qt. Finally I came across some references to the font cache, so it dawned on me that cleaning the font cache could be worthwile. I found a simple recipe to clean the font cache and that finally solved the problem.
Now Calibre appears to run fine. However, Console app still displays a Calibre error message regularly:
Traceback (most recent call last): File "calibre/utils/Zeroconf.pyo", line 863, in run File "calibre/utils/Zeroconf.pyo", line 908, in handle_read File "calibre/utils/Zeroconf.pyo", line 469, in __init__ File "calibre/utils/Zeroconf.pyo", line 495, in readQuestions File "calibre/utils/Zeroconf.pyo", line 262, in __init__ NonLocalNameException
And here is another one:
Traceback (most recent call last): File "calibre/utils/Zeroconf.pyo", line 863, in run File "calibre/utils/Zeroconf.pyo", line 908, in handle_read File "calibre/utils/Zeroconf.pyo", line 470, in __init__ File "calibre/utils/Zeroconf.pyo", line 542, in readOthers File "calibre/utils/Zeroconf.pyo", line 592, in readName File "calibre/utils/Zeroconf.pyo", line 575, in readUTF File "encodings/utf_8.pyo", line 16, in decode UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0: unexpected code byte
Calibre 0.6.19
Today Calibre 0.6.19 was released, so I installed this version. First I quit the running Calibre (0.6.18), which generated this error message:
/Applications/calibre.app/Contents/Resources/lib/python2.6/site-packages.zip/cherrypy/process/wspbus.py:174: RuntimeWarning: The main thread is exiting, but the Bus is in the states.STARTED state; shutting it down automatically now. You must either call bus.block() after start(), or call bus.exit() before the main thread exits.
Then the new one gave these errors:
Exception in thread Thread-3 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "threading.pyo", line 522, in __bootstrap_inner File "calibre/utils/ipc/server.pyo", line 166, in run File "Queue.pyo", line 177, in get File "threading.pyo", line 252, in wait <type 'exceptions.TypeError'>: 'NoneType' object is not callable Exception in thread Thread-4 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "threading.pyo", line 522, in __bootstrap_inner File "calibre/gui2/device.pyo", line 436, in run File "threading.pyo", line 115, in acquire <type 'exceptions.TypeError'>: 'NoneType' object is not callable Exception in thread Thread-5 (most likely raised during interpreter shutdown): Exception in thread Thread-42 (most likely raised during interpreter shutdown): Traceback (most recent call last): Exception in thread Thread-44 (most likely raised during interpreter shutdown): File "threading.pyo", line 522, in __bootstrap_inner File "calibre/gui2/device.pyo", line 174, in runTraceback (most recent call last): Traceback (most recent call last): File "threading.pyo", line 522, in __bootstrap_inner File "calibre/utils/Zeroconf.pyo", line 850, in run File "threading.pyo", line 522, in __bootstrap_inner File "calibre/utils/ipc/server.pyo", line 166, in run File "calibre/utils/Zeroconf.pyo", line 871, in getReaders File "threading.pyo", line 115, in acquire <type 'exceptions.TypeError'>: 'NoneType' object is not callable <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'sleep' File "Queue.pyo", line 177, in get File "threading.pyo", line 252, in wait <type 'exceptions.TypeError'>: 'NoneType' object is not callable link hasn't been detected! link hasn't been detected! <Error>: kCGErrorIllegalArgument: CGSOrderWindowList <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. link hasn't been detected!
(the last line repeared several times)