05-01-2010, 09:45 PM | #1 |
Member
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 |
05-02-2010, 12:46 AM | #2 |
creator of calibre
Posts: 44,329
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Make sure your plugin .py file contains only ASCII
|
Advert | |
|
05-15-2010, 12:39 PM | #3 |
Addict
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 |
05-15-2010, 12:47 PM | #4 |
creator of calibre
Posts: 44,329
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
notepad++ should do the trick
|
05-15-2010, 05:48 PM | #5 |
Addict
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
|
Advert | |
|
05-15-2010, 05:52 PM | #6 |
creator of calibre
Posts: 44,329
Karma: 23661992
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++
|
05-15-2010, 06:10 PM | #7 |
Grand Sorcerer
Posts: 11,932
Karma: 7208979
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
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.
|
05-15-2010, 06:20 PM | #8 |
creator of calibre
Posts: 44,329
Karma: 23661992
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.
|
05-15-2010, 08:27 PM | #9 | |
Addict
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Quote:
Thanks for trying to help, though. |
|
05-15-2010, 08:51 PM | #10 |
Addict
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. |
05-15-2010, 09:13 PM | #11 |
creator of calibre
Posts: 44,329
Karma: 23661992
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? |
05-15-2010, 11:24 PM | #12 | |
Addict
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Quote:
I'll have to play with it more tomorrow. |
|
05-16-2010, 11:11 AM | #13 |
Junior Member
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.
|
05-16-2010, 11:14 AM | #14 |
creator of calibre
Posts: 44,329
Karma: 23661992
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 |
05-16-2010, 12:14 PM | #15 | |
Addict
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Quote:
Thanks Kovid. I went through this morning and re-installed notepad++ and everything seems to be working again. |
|
|
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 |