Cannot read SDCard on Kobo eReader

Bug #1174815 reported by Josh Audette
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
David Forrester

Bug Description

I can read the Kobo main memory, but when it tries to read the SD card I get a bunch of these:

Traceback (most recent call last):
  File "site-packages/calibre/devices/kobo/driver.py", line 232, in update_booklist
  File "site-packages/calibre/devices/kobo/driver.py", line 671, in book_from_path
TypeError: __init__() takes at most 5 arguments (11 given)

I see several screensfull of these four lines over and over again.

I have an older Kobo eReader (no touch screen, no wireless). Running calibre 0.9.28.

The main memory and SD card both mount properly, and calibre does create a couple of .calibre files on the SD card so I assume it is able to read and write.

Tags: kobo-driver

Related branches

Revision history for this message
Josh Audette (norm-0) wrote :

I did search the bug tracker and I did a bunch of Googling for this issue as well, and I found nothing related to this. If this is a common / easily solved issue please reply to let us know; I'm sure anyone else with this issue will appreciate being able to find a resolution here.

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1174815

Changing the component for this bug.

 assignee davidfor
 tag kobo-driver
 status triaged

Changed in calibre:
assignee: nobody → David Forrester (davidfor)
status: New → Triaged
Revision history for this message
David Forrester (davidfor) wrote :

Wow, that has been there a long time. I am very surprised that no-one has hit that before.

From where the error occurs, it appears that the SD card already had books on it, but that calibre hadn't seen them before. The fix is simple, but unfortunately, I do not have a an original Kobo ereader, so I have no way to test it.

@Kovid: The change moves the definition of "book_class" for the KOBO class to a position that matches the other classes that do this. That should guarantee the correct class is used.

Revision history for this message
Mark Brezina (mabrezina) wrote :
Download full text (52.8 KiB)

Hi, I'm having this same error on my Kobo Wifi. Calibre is not listing any books on the device - from main memory or the SD card. I have the latest Calibre and Kobo firmware. Here is the debug log. Please fix as I want to transfer the 100 + 3 factory books to a new Kobo device.

calibre Debug log
calibre 0.9.28 isfrozen: True is64bit: False
Windows-7-6.1.7601-SP1 Windows ('32bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.3
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Starting up...
Started up in 8.23 seconds with 1 books
Job: 1 Get device information started
DeviceJob: 1 Get device information done, calling callback
DeviceJob: 1 Get device information callback returned
Job: 2 Get list of books on device started
DEBUG: 0.0 Version of driver: (2, 0, 8) Has kepubs: True
DEBUG: 0.0 Version of firmware: 1.9 Has kepubs: True
DEBUG: 0.0 Database Version: 77
DEBUG: 0.2 prefix: G:\ lpath: Kobo_eReader_User_Guide.epub title: Kobo eReader User Guide authors: Kobo Inc. mime: application/epub+zip date: 2010-10-07 ContentType: 6 ImageID: file____mnt_onboard_Kobo_eReader_User_Guide_epub
Traceback (most recent call last):
  File "site-packages\calibre\devices\kobo\driver.py", line 232, in update_booklist
  File "site-packages\calibre\devices\kobo\driver.py", line 671, in book_from_path
TypeError: __init__() takes at most 5 arguments (11 given)
DEBUG: 0.2 prefix: G:\ lpath: .kobo/kepub/436e9c83-9bd2-489d-b994-7aba2f88a2e2 title: The Art Of War authors: Sun Tzu mime: application/epub+zip date: 1970-01-01T00:00:00.000 ContentType: 6 ImageID: sYOTt_x8Hkm7ZQN2kuAoiQ
Traceback (most recent call last):
  File "site-packages\calibre\devices\kobo\driver.py", line 232, in update_booklist
  File "site-packages\calibre\devices\kobo\driver.py", line 671, in book_from_path
TypeError: __init__() takes at most 5 arguments (11 given)
DEBUG: 0.2 prefix: G:\ lpath: .kobo/kepub/ba556d9e-36d0-4729-b856-ccd7ed945bfe title: Alice's Adventures In Wonderland authors: Lewis Carroll mime: application/epub+zip date: 1970-01-01T00:00:00.000 ContentType: 6 ImageID: Vsdoxk3ZjEOf4xgMizJbMQ
Traceback (most recent call last):
  File "site-packages\calibre\devices\kobo\driver.py", line 232, in update_booklist
  File "site-packages\calibre\devices\kobo\driver.py", line 671, in book_from_path
TypeError: __init__() takes at most 5 arguments (11 given)
DEBUG: 0.2 prefix: G:\ lpath: .kobo/kepub/04fc19e1-46cc-4326-8749-6132a0b8897c title: Aesop's Fables authors: Aesop mime: application/epub+zip date: 1970-01-01T00:00:00.000 ContentType: 6 ImageID: LOvD6xsAHkKbEbUnslePPg
Traceback (most recent call last):
  File "site-packages\calibre\devices\kobo\driver.py", line 232, in update_booklist
  File "site-packages\calibre\devices\kobo\driver.py", line 671, in book_from_path
TypeError: __init__() takes at most 5 arguments (11 given)
DEBUG: 0.3 prefix: G:\ lpath: .kobo/kepub/535b3924-e82d-4aee-b562-d62135181ad7 title: The Adventures Of Tom Sawyer authors: Mark Twain mime: application/epub+zip date: 1970-01-01T00:00:00.000 ContentType: 6 ImageID: uer1n-cjgEaXQM5fsxUx9Q
Traceback (most recent call last):
  File "...

Revision history for this message
David Forrester (davidfor) wrote :

Mark,

That looks like the same problem and should be solved with the fix above.

But, it won't help you with what you want to do. The books causing the error for you are all kepubs. These cannot be copied off the device and copied to another. Or at least not via calibre. All of these books are probably classics that are free on the Kobo web site. And most will be in the public domain. That means you should be able to find a copy elsewhere. I recommend looking in the MobileRead library as if there is a version there, they tend to be the best versions available.

Revision history for this message
Josh Audette (norm-0) wrote :

You're right about the SD card's books. I got the Kobo, put some ePubs on it and used it for awhile before I discovered Calibre, so when Calibre saw the device and card for the first time it had those books on it.

Also I gotta say I've only used Calibre for a couple of days but it is amazing! Thank you David and Kovid and the others in your group for this fantastic application.

The patch looks really simple. Right now I'm using the binary from the website but I'll give the source a try. If I can compile it and try the patch out I'll let you know how it goes.

If not, it sounds like an alternate solution would be to take those books from the SD card and put them in my Calibre library, then clean the SD card and use Calibre to put them back on the card?

Revision history for this message
David Forrester (davidfor) wrote :

@Josh: If you want to try running from source, that would be good. The instructions for getting it are at http://www.calibre-ebook.com/get-involved. And there is a link there to the development section of the user manual which has the instructions needed for actually running calibre.

Revision history for this message
Josh Audette (norm-0) wrote :

I downloaded src, applied the patch, ran using the CALIBRE_DEVELOP_FROM method, and confirmed that the patch worked.

Error did not appear, and all the books that I have on the SD card show up properly in Calibre.

Thank you David!

Revision history for this message
Mark Brezina (mabrezina) wrote :

@David: Is there any version of the Kobo reader plugin that will allow me to retreive and then convert kepub books? Its not so much for the 100 public domain books, but the 3 other promotional books (the Girl with the Dragon Tattoo series) in the database that I want to transfer to my new reader.

Revision history for this message
David Forrester (davidfor) wrote :

@Josh: Glad it worked and thanks for the help.

@Mark: There isn't an automatic way. The issue is DRM. If the kepub has DRM, there isn't anything you can do with it. But, if it does not have DRM, it can be copied and treated as an epub.

If the new reader is a Kobo reader, the three books should just sync to the new reader. If they don't, complain to the Kobo support. If it is another type, have a look in you account on the Kobo site. The books should be in it and there my be a link to download the epub versions.

Revision history for this message
David Forrester (davidfor) wrote :

@Kovid: Was there a problem with the patch that this didn't go in last week? Comment #8 shows it fixed the problem for the reporter.

Revision history for this message
Kovid Goyal (kovid) wrote :

Sorry, I must have missed it somehow.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in lp:calibre

Fixed in branch lp:calibre. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: Triaged → Fix Released
Revision history for this message
Mark Brezina (mabrezina) wrote :

I was wondering about the patch as well.. it was not in last week's calibre release.

I now have the source and build environment configured in OSX, can you direct me how to patch my kobo driver.py source file so I can test it out?

Thanks.

Revision history for this message
Mark Brezina (mabrezina) wrote :

Nevermind, I merged the patch and its working - I can now see the virtual books on my Kobo. Thanks for posting it in the branch.

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1174815

bzr merge /path/to/patch/file

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.