Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-17-2011, 07:03 AM   #1
webwizard
Member
webwizard began at the beginning.
 
webwizard's Avatar
 
Posts: 14
Karma: 10
Join Date: Feb 2011
Device: Kindle DX
calibredb strange behaviour

I am still missing something.

I try to pull out the OPF structure using:

Code:
calibredb show_metadata --as-opf 1127 >zzzzz.txt
and immediately typing

Code:
calibredb set_metadata 1127 zzzzz.txt
produces this error:
Code:
Python function terminated unexpectedly
  'charmap' codec can't encode characters in position 280-283: character maps to
 <undefined> (Error Code: 1)
Traceback (most recent call last):
  File "site.py", line 103, in main
  File "site.py", line 85, in run_entry_point
  File "site-packages\calibre\library\cli.py", line 1183, in main
  File "site-packages\calibre\library\cli.py", line 483, in command_set_metadata

  File "site-packages\calibre\library\cli.py", line 459, in do_set_metadata
  File "site-packages\calibre\library\cli.py", line 429, in do_show_metadata
  File "encodings\cp1252.py", line 12, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 280-283:
 character maps to <undefined>
What's the catch ? I attached the xxxxx.txt file and the original metadata.opf from Calibre DB.
Attached Files
File Type: txt zzzzz.txt (2.4 KB, 50 views)
File Type: opf metadata.opf (2.6 KB, 39 views)
webwizard is offline   Reply With Quote
Old 04-17-2011, 09:07 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,622
Karma: 4998447
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
redirect the output from show_metadata to a file. The windows console in its default configuration cannot handle unicode output very well.
kovidgoyal is offline   Reply With Quote
Old 04-17-2011, 09:23 AM   #3
webwizard
Member
webwizard began at the beginning.
 
webwizard's Avatar
 
Posts: 14
Karma: 10
Join Date: Feb 2011
Device: Kindle DX
Quote:
Originally Posted by kovidgoyal View Post
redirect the output from show_metadata to a file. The windows console in its default configuration cannot handle unicode output very well.
Good advice. How do I do it ?
webwizard is offline   Reply With Quote
Old 04-17-2011, 09:23 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,622
Karma: 4998447
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
the same way you did it in your first command
kovidgoyal is offline   Reply With Quote
Old 04-17-2011, 09:29 AM   #5
webwizard
Member
webwizard began at the beginning.
 
webwizard's Avatar
 
Posts: 14
Karma: 10
Join Date: Feb 2011
Device: Kindle DX
Quote:
Originally Posted by kovidgoyal View Post
the same way you did it in your first command
Well, something has to be changed, since what I did in the first command results in an error. Doing it in the same way yeld the same result...
webwizard is offline   Reply With Quote
Old 04-17-2011, 09:30 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,622
Karma: 4998447
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibredb set_metadata 1127 zzzzz.txt > out.txt
kovidgoyal is offline   Reply With Quote
Old 04-17-2011, 09:50 AM   #7
webwizard
Member
webwizard began at the beginning.
 
webwizard's Avatar
 
Posts: 14
Karma: 10
Join Date: Feb 2011
Device: Kindle DX
Quote:
Originally Posted by kovidgoyal View Post
calibredb set_metadata 1127 zzzzz.txt > out.txt
No luck so far...

Code:
U:\opf>chcp 65001
Tabella codici attiva: 65001

U:\opf>calibredb show_metadata --as-opf 1127 >zzzzz.txt

U:\opf>calibredb set_metadata 1127 zzzzz.txt > out.txt
Traceback (most recent call last):
  File "site.py", line 103, in main
  File "site.py", line 85, in run_entry_point
  File "site-packages\calibre\library\cli.py", line 1183, in main
  File "site-packages\calibre\library\cli.py", line 483, in command_set_metadata

  File "site-packages\calibre\library\cli.py", line 459, in do_set_metadata
  File "site-packages\calibre\library\cli.py", line 429, in do_show_metadata
  File "encodings\cp1252.py", line 12, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 280-283:
 character maps to <undefined>

U:\opf>type out.txt
Python function terminated unexpectedly
  'charmap' codec can't encode characters in position 280-283: character maps to
 <undefined> (Error Code: 1)

U:\opf>
webwizard is offline   Reply With Quote
Old 04-17-2011, 10:02 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,622
Karma: 4998447
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Ah you have characters in your metadata that cannot be encoded in mbcs. Dont worry about the error, it just means calibre failed to print out the updated metadata. The metadata will still have been updated.
kovidgoyal is offline   Reply With Quote
Old 04-17-2011, 10:14 AM   #9
webwizard
Member
webwizard began at the beginning.
 
webwizard's Avatar
 
Posts: 14
Karma: 10
Join Date: Feb 2011
Device: Kindle DX
Quote:
Originally Posted by kovidgoyal View Post
Ah you have characters in your metadata that cannot be encoded in mbcs. Dont worry about the error, it just means calibre failed to print out the updated metadata. The metadata will still have been updated.
So I can ignore the error and go on ?
webwizard is offline   Reply With Quote
Old 04-17-2011, 10:17 AM   #10
webwizard
Member
webwizard began at the beginning.
 
webwizard's Avatar
 
Posts: 14
Karma: 10
Join Date: Feb 2011
Device: Kindle DX
Quote:
Originally Posted by webwizard View Post
So I can ignore the error and go on ?
OK, it seems that removing the unicode characters in the custom field from Calibre GUI and redoing the whole cmd procedure, things work again.

I'll deal with that in a different way.

Thanks

paul
webwizard is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange behaviour with PDFs timlegge Kobo Reader 3 06-24-2010 10:53 PM
Strange behaviour of TOC for one character paulpeer Calibre 6 03-07-2010 12:03 PM
Strange charging behaviour bob_ninja Bookeen 2 01-15-2010 07:44 AM
Strange Behaviour poshm PocketBook 9 12-31-2009 09:39 AM
2.11 Strange behaviour on startup ElaHuguet iRex 3 10-03-2007 02:03 PM


All times are GMT -4. The time now is 06:45 AM.


MobileRead.com is a privately owned, operated and funded community.