Incorrectly formed file names written to device in 2.5.1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Kobo Touch Extended Driver |
Fix Released
|
Low
|
Joel Goguen |
Bug Description
Using the KoboTouchExtended driver v. 2.5.1 to write kepubs to device results in unexpected file names.
My naming template is "{author_
Instead, it is written as "War and Peac.kepub.epub".
The cause is introduced in commit https:/
The line is:
path = path.rstrip(
Problem being the rstrip function used to strip the EPUB_EXT extension (ie. '.epub') as rstrip strips all listed characters from the end of the string and not the substring as probably intended.
So for string like 'Deep.epub' rstrip('.epub') would produce 'D'.
Changed in calibre-kobo-driver: | |
status: | New → Triaged |
importance: | Undecided → Low |
assignee: | nobody → Joel Goguen (jgoguen) |
Changed in calibre-kobo-driver: | |
status: | Triaged → Fix Released |
Ahh, misuse of str.rstrip(). Since names that aren't UUIDs are purely for convenience (Kobo drops KePubs as $UUID.kepub.epub) this isn't all that important. The biggest problem is name collisions if a name ends with a combination of the characters '.epub', which isn't too likely I don't think. Will get to this when I have a few minutes, looks like using str.replace() instead should fix this. Might even announce a new major version that does it more like Kobo and forces using UUID names.