05-07-2024, 09:02 PM | #1 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2016
Device: mobi
|
AttributeError: Custom field name '' must begin with '#'
AttributeError: Custom field name '' must begin with '#'
... after successful editing cleanup and saving an EPUB, then trying to convert it to MOBI, which failed, so re-opening the EPUB in Calibre Ebook 7.10 editor gets the above error, and Caliber Ebook now refuses to open the EPUB for editing. Calibre Ebook v7.10 apparently can't auto fix it? Why present an error and not a fix? I tried other in-computer and on-line converters and 'fixers', zipping and re-opening, all failed. Anyway, how to fix it, please. And how to PREVENT it. Oddly, Calibre Ebook 7.10 itself can open the EPUB for reading on screen, no problem, end to end, the entire book is there exactly as it left the editing process. Post Script - Amazon converted it to KFX just fine ( via email send EPUB to device ). So, if Calibre Ebook can't 'fix' an "AttributeError: Custom field name '' must begin with '#'" by inserting a '#' itself, how can I do it outside the Calibre Ebook program to move forward after the Caliber Ebook program munged the EPUB? Thanks. . Last edited by Peter Blaise; 05-08-2024 at 07:23 AM. |
05-07-2024, 09:46 PM | #2 |
Wizard
Posts: 1,355
Karma: 6794938
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Does the error point to where exactly the custom filed name is?
Maybe post a screenshot of the code you are using? |
Advert | |
|
05-07-2024, 10:08 PM | #3 |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
You are trying to embed / use data from a custom column when sending a book
Your template is missing the # (templates us LOOKUP names) |
05-08-2024, 08:10 AM | #4 | |||||
Member
Posts: 19
Karma: 10
Join Date: Dec 2016
Device: mobi
|
Thanks for considering this, let's play ...
After 18 successful conversions of other EPUB to MOBI with this Calibre Ebook installation software through versions 7.7, 7.9, and 7.10, from April to now, about a month, ( and I successfully test-converted an additional EPUB to MOBI after this error ) here are some error contents for this particular EPUB: CONVERT EPUB TO MOBI ERROR: Quote:
So let's try re-editing it: ERROR OPENING EPUB FOR EDITING: Quote:
Let's try embedding metadata: Quote:
OK, let's polish the book: Quote:
Now, if I were to look for: File "calibre\ebooks\metadata\book\base.py" ... where would I look? Windows File Explorer found: C:\Program Files\LibreOffice\program\python-core-3.8.19\lib\email\mime\base.py Quote:
But somehow I suspect that's not the problem, it's just the complainer, the problem is somewhere else, somewhere earlier. More important to me as an end user . . . . why present me with an error I cannot fix INSTEAD of just going ahead and fixing the error and moving on? Saying "Note, fixed an error by adding # in front of custom field name, if this auto-repaired EPUB misbehaves, please reload the original and try again". Considering that Amazon had no problem converting this supposedly now uneditable by Calibre Ebook EPUB, I'd think that, yes, an auto fix is quite possible. What to do now? Thanks for exploring what might be going wrong here. Post script: I tried deleting all user medatada, no difference, same errors for this EPUB. I have ONE custom column that works for everything else, even for this EPUB, but toggled off or on, empty or with something in the column, same errors: . . Last edited by Peter Blaise; 05-08-2024 at 08:30 AM. |
|||||
05-08-2024, 10:23 AM | #5 |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
#sent is not valid THERE. That should just say sent THERE
OTOH your Template MUST use {#sent} In essence, you doubled up the #, which confused the parser |
Advert | |
|
05-08-2024, 10:30 AM | #6 |
creator of calibre
Posts: 44,540
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Somebody has tampered with that epub file leaving behind invalid metadata in its OPF. https://github.com/kovidgoyal/calibr...2b080895ad476f
|
05-08-2024, 03:05 PM | #7 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2016
Device: mobi
|
Fascinating insights.
The original EPUB file edits fine, and converts fine, and of course, Amazon convers the 'tampered metadata' EPUB file fine, and the 'tempered metadata' EPUB reads fine even in the Calibre Ebook native on-screen reader. Calibre Ebook can read and display the EPUB just fine, but cannot open the 'tempered metadata' EPUB to edit, save metadata, polish, or covert the EPUB to another format. Calibre Ebook program was the only thing that touched the EPUB, and I used the various auto-fix features copiously without error before saving and exiting out before then trying to convert:
And Calibre Ebook puts it's own # in the custom column control panel, I did not put a # in the column name, see here: The ODF file is 17 KB and has no # marks in it, according to Windows Notepad character search. =========================================== I CAN duplicate the error, starting with a fresh copy of the original EPUB before editing. When simplifying and flattening a table of contents ( all entries are h2 at the top of their own separate page file, subordinate 'headings' inside a 'chapter' are converted to <p><b>...</b></p> and are no longer in the table of contents), and then removing the 'noise' after #, such as #toc_1", #toc_2" in table of contents and reference files, replacing:
with
. . . "check book" says all is OK. But save and exit, then I can't re-open the book for editing or converting. Ouch! So, on the one hand, don't clean up the ...#toc"-style table of contents references, even though "check book" says those are errors. On the other hand, why does "check book" think a file is then OK with those errors removed if then the file can never be opened again after saving? And, most importantly, why can't Calibre Ebook 'fix' the error on reopening the file to allow the user to get to the EPUB contents regardless of any metadata errors ( metadata errors that are apparently meaningless to Caliber Ebook's own reader and meaningless to Amazon's converter )? In other words, thanks for the report on metadata, but as an end user, I'm using Calibre Ebook as an ebook editor ( primarily ), not a metadata editor ( a hopefully invisible yet discardable thing to us end users ). That Calibre Ebook editor can manipulate metadata is terrific, but subordinate to the actual authored ( 'precious' ) contents of an ebook. My goal is to strip an ebook file down to essentially only what can be heard when reading the contents out loud - that does not include metadata in anyway ( though I understand there may be metadata codes for read-out-loud programs to control pauses, inflection, and such, but such audio metadata is not on my event horizon at the moment ). All that aside: . . . could there be a way for Calibre Ebook to offer to open the contents of an ebook stripped of it's metadata, especially when Calibre Ebook finds errors in the metadata? . . . instead of just saying "I can't open this ebook's contents, it's too hard to figure out what's what". Or separately, is there a way to 'import' just the ebook's authored contents on demand? ========================================== OK, three things: 1 - the "check book" inside the editor seems out of sync with the book checking routines in the external main-window parts of the Calibre Ebook program, such that they do not agree with each other whether an EPUB is OK or not - it would be nice if the editor's "check book" had the same savvy and warning BEFORE exiting the ebook editor to then never be able to reopen it for editing. 2 - It would be terrific if the editor, upon opening an ebook, offered to fix broken metadata, even tossing metadata if necessary, to allow the user to at least get to the authored ebook contents, even if devoid of formatting or demarcations that metadata might have provided. 3 - is there a way to import a stripped ebook without it's metadata? Thanks. . Last edited by BetterRed; 05-08-2024 at 06:49 PM. Reason: thumbnail an OVERSIZE image |
05-08-2024, 06:55 PM | #8 |
null operator (he/him)
Posts: 20,997
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Moderator Notice
@Peter Blaise - Please read and comply with MR Guidelines, in this instance #9. Thank you BR |
05-08-2024, 07:17 PM | #9 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2016
Device: mobi
|
Metatopic: "...BetterRed wrote: @Peter Blaise - Please read and comply with https://www.mobileread.com/forums/fa...ing_guidelines MR Guidelines, in this instance #9. Thank you BR ..." From that link, #9 ... Images included in posts must be no more than 600x600 pixels ... By doing what? Are you saying that MobileRead does not itself present image references within a 600x600 pixel box? That would be a terrific solution! The links I provided are to images hosted elsewhere so MobileRead does not have to host images - I don't even see the ability to upload images to a MobilRead post. Is there a way to 'thumbnail' the image links to 600x600 or less when we 'attach' an image link? You seem to have re-attached a copy of my image as just a number as if the copy is now hosted inside MobilRead ( I didn't give permission, but I don't care, someone else might care who hosts their own images ). When we click on the "Insert image" it asks for a link, but apparently MobileRead does not resize or check the size? How do we tell MobilRead to resize in the post or just put a thumbnail of the reference image? Here are the image addresses I used:
https://i.ibb.co/FVqv2Nd/Calibre-Ebo...2024-05-08.png https://i.ibb.co/WKJSKDK/calibre-put...2-19-09-PM.png I guess it keeps the thread from having a BIG image in the middle of it. Is there a 'best practices' way of giving folks a full image available for them to see what we're writing about? Thanks. Last edited by Peter Blaise; 05-09-2024 at 12:17 PM. |
05-08-2024, 07:43 PM | #10 |
Bibliophagist
Posts: 40,521
Karma: 156983616
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Take a look at the paperclip tool at the top of the message entry box in Advanced mode. Or the Manage Attachments button below the message entry box in Advanced mode. Simply click on the thumbnail to see the full size image.
|
05-08-2024, 07:49 PM | #11 |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Another reason is some folk are bandwidth limited or have tiny screens.
|
05-09-2024, 12:04 PM | #12 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2016
Device: mobi
|
How about a META DISCISSIONS forum so we can have side chats, "discussions about our discussions", "discussions about the MobileRead forums operation itself", OFF THREAD? So interrupters can briefly write "over here ___ link to discuss ____ problem", OFF THREAD. . I'm just trying to let master chef Kovid Goyal know that there's a mismatch between
And ask if there's a way to 'fix' or re-import an EPUB without the supposedly now malformatted metadata. Thanks. . Last edited by Peter Blaise; 05-09-2024 at 12:20 PM. |
05-09-2024, 02:09 PM | #13 | |
Bibliophagist
Posts: 40,521
Karma: 156983616
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
05-09-2024, 03:11 PM | #14 |
Resident Curmudgeon
Posts: 76,402
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
05-09-2024, 03:21 PM | #15 |
Well trained by Cats
Posts: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
and all the checkers in the world won't catch all the wrong info INSIDE the box.
Title set check date set check (was set to 2095 but check was happy) |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom field based on multiple value field for export | nindotza | Calibre | 0 | 01-02-2021 09:37 AM |
CC - custom field not displaying | SgtDave | Calibre Companion | 6 | 01-04-2019 10:43 AM |
Question about populating custom field | jmricker | Plugins | 3 | 08-09-2014 03:10 PM |
Custom field for 'original language' | wladdy | Library Management | 1 | 08-08-2014 02:26 PM |
Custom Metadata Field | gpp | Sigil | 6 | 02-22-2011 09:39 AM |