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

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 05-01-2010, 09:45 PM   #1
modkindle
Member
modkindle began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: kindle
Error Adding Plugin

My last question of the night I promise!

I am running Calibre 0.6.51

I am attempting to add a plugin. I have tried a couple different versions of the source code and I am zipping it using 7-Zip.

This is the error I get.

ERROR: ERROR: Unhandled exception: <b>UnicodeDecodeError</b>:'utf8' codec can't decode byte 0x88 in position 11: unexpected code byte

Traceback (most recent call last):
File "site-packages\calibre\gui2\dialogs\config\__init__.py", line 531, in add_plugin
File "site-packages\calibre\customize\ui.py", line 271, in add_plugin
File "site-packages\calibre\customize\ui.py", line 65, in load_plugin
File "encodings\utf_8.py", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0x88 in position 11: unexpected code byte
modkindle is offline   Reply With Quote
Old 05-02-2010, 12:46 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,910
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Make sure your plugin .py file contains only ASCII
kovidgoyal is offline   Reply With Quote
Old 05-15-2010, 12:39 PM   #3
junkml
Addict
junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.
 
junkml's Avatar
 
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
Kovid,

Can you suggest a good editing program for windows? I've created and run plugins before, but for some reason when I edited one today, I started getting the same type of utf-8 error.

I was hoping you might know of a good editor for python files for windows. What I've been using doesn't seem to work anymore.

xfeTraceback (most recent call last):
File "site.py", line 103, in main
File "site.py", line 85, in run_entry_point
File "site-packages\calibre\debug.py", line 120, in main
File "site-packages\calibre\debug.py", line 80, in add_simple_plugin
File "site-packages\calibre\customize\ui.py", line 457, in main
File "site-packages\calibre\customize\ui.py", line 271, in add_plugin
File "site-packages\calibre\customize\ui.py", line 65, in load_plugin
File "encodings\utf_8.py", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0xaf in position 12: unexpect
ed code byte
junkml is offline   Reply With Quote
Old 05-15-2010, 12:47 PM   #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,910
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
notepad++ should do the trick
kovidgoyal is offline   Reply With Quote
Old 05-15-2010, 05:48 PM   #5
junkml
Addict
junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.
 
junkml's Avatar
 
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
Quote:
Originally Posted by kovidgoyal View Post
notepad++ should do the trick
Hmm. Is there a setting I'm missing then? That's what I used in the past, and what I'm currently using.

Weird.
junkml is offline   Reply With Quote
Old 05-15-2010, 05:52 PM   #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,910
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Dunno, I don't really use windows, so I have only the most rudimentary familiarity with notepad++
kovidgoyal is offline   Reply With Quote
Old 05-15-2010, 06:10 PM   #7
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,411
Karma: 821648
Join Date: Jan 2010
Location: France
Device: Many android devices
I have used vim with success. I currently use eclipse with pydev, along with anyedit to clean up lines when writing. That being said, I have not tried to write strings with non-latin characters, so your mileage might vary.
chaley is offline   Reply With Quote
Old 05-15-2010, 06:20 PM   #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,910
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Note that in a python file you can always escape non ascii characters in strings. I would recommend doing that, as it's the most portable, provided you dont have too many such characters.
kovidgoyal is offline   Reply With Quote
Old 05-15-2010, 08:27 PM   #9
junkml
Addict
junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.
 
junkml's Avatar
 
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
Quote:
Originally Posted by kovidgoyal View Post
Note that in a python file you can always escape non ascii characters in strings. I would recommend doing that, as it's the most portable, provided you dont have too many such characters.
Thanks for the help, I'll just have to keep seeing what I can find. I'm not using non-ascii characters, and I barely changed the script from what it was before. I even changed it back and tried to use it, and I get the error above.

Thanks for trying to help, though.
junkml is offline   Reply With Quote
Old 05-15-2010, 08:51 PM   #10
junkml
Addict
junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.
 
junkml's Avatar
 
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
I've stripped this down to where it's just doing a "print" statement, so I can see what's happening when I use calibre on the command line.

Maybe someone could take a look and see what the heck I've screwed up. I'm kind of frustrated, since this file was working perfectly until I edited it today.

When I use calibre-debug --add-simple-plugin epub_plugin.zip, I get:
(most recent call last):
File "site.py", line 103, in main
File "site.py", line 85, in run_entry_point
File "site-packages\calibre\debug.py", line 120, in main
File "site-packages\calibre\debug.py", line 80, in add_simple_plugin
File "site-packages\calibre\customize\ui.py", line 457, in main
File "site-packages\calibre\customize\ui.py", line 271, in add_plugin
File "site-packages\calibre\customize\ui.py", line 65, in load_plugin
File "encodings\utf_8.py", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0xaf in position 12: unexpect
ed code byte

Last edited by junkml; 05-16-2010 at 06:16 PM.
junkml is offline   Reply With Quote
Old 05-15-2010, 09:13 PM   #11
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,910
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I was able to add that plugin to calibre and I don't see the byte 0xaf anywhere in the .py file

Are you sure you're adding the correct file?
kovidgoyal is offline   Reply With Quote
Old 05-15-2010, 11:24 PM   #12
junkml
Addict
junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.
 
junkml's Avatar
 
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
Quote:
Originally Posted by kovidgoyal View Post
I was able to add that plugin to calibre and I don't see the byte 0xaf anywhere in the .py file

Are you sure you're adding the correct file?
That's aggravating. I'm pretty sure I'm adding the right .zip file, as the datetime stamp matched what I had just built.

I'll have to play with it more tomorrow.
junkml is offline   Reply With Quote
Old 05-16-2010, 11:11 AM   #13
DokaMax
Junior Member
DokaMax began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2010
Device: iPhone
You can try this http://mmm-experts.com/download/PyScripter-setup.exe PyScripter for Windows Py editig. I was try add your plugin and have no error.
DokaMax is offline   Reply With Quote
Old 05-16-2010, 11:14 AM   #14
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,910
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Ah, now I see it, if you're using --add-simple-plugin then you pass it the path to the .py file not the zip file (the idea is that it makes it easy to add plugins that have only a single py file)

If you want to add the zip file use

calibre-customize --add path to zip file
kovidgoyal is offline   Reply With Quote
Old 05-16-2010, 12:14 PM   #15
junkml
Addict
junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.
 
junkml's Avatar
 
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
Quote:
Originally Posted by kovidgoyal View Post
Ah, now I see it, if you're using --add-simple-plugin then you pass it the path to the .py file not the zip file (the idea is that it makes it easy to add plugins that have only a single py file)

If you want to add the zip file use

calibre-customize --add path to zip file


Thanks Kovid.

I went through this morning and re-installed notepad++ and everything seems to be working again.
junkml 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
Possible error with adding new format of book already in Calibre TalpaEuropea Calibre 1 02-14-2010 08:51 AM
Error with adding font to EPUB news recipe megabadd Calibre 2 01-11-2010 10:16 AM
Error Customising PRS600 plugin markbond1007 Plugins 0 01-11-2010 07:18 AM
Error adding books Gfinch Calibre 2 08-03-2008 08:36 PM
Libprs500- error with adding previously converted books bluesnews Calibre 4 04-08-2008 11:06 PM


All times are GMT -4. The time now is 05:35 AM.


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