![]() |
#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 06:23 AM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,284
Karma: 6700678
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 | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,277
Karma: 57979022
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) |
![]() |
![]() |
![]() |
#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 07:30 AM. |
|||||
![]() |
![]() |
![]() |
#5 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,277
Karma: 57979022
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 | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,263
Karma: 23661992
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
|
![]() |
![]() |
![]() |
#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 05:49 PM. Reason: thumbnail an OVERSIZE image |
![]() |
![]() |
![]() |
#8 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 20,855
Karma: 27620684
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 |
![]() |
![]() |
![]() |
#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 11:17 AM. |
![]() |
![]() |
![]() |
#10 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38,927
Karma: 153006036
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.
|
![]() |
![]() |
![]() |
#11 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,277
Karma: 57979022
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.
|
![]() |
![]() |
![]() |
#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 11:20 AM. |
![]() |
![]() |
![]() |
#13 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38,927
Karma: 153006036
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,680
Karma: 134319570
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#15 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,277
Karma: 57979022
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 ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom field based on multiple value field for export | nindotza | Calibre | 0 | 01-02-2021 08:37 AM |
CC - custom field not displaying | SgtDave | Calibre Companion | 6 | 01-04-2019 09:43 AM |
Question about populating custom field | jmricker | Plugins | 3 | 08-09-2014 02:10 PM |
Custom field for 'original language' | wladdy | Library Management | 1 | 08-08-2014 01:26 PM |
Custom Metadata Field | gpp | Sigil | 6 | 02-22-2011 08:39 AM |