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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-04-2017, 05:13 AM   #1
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Edit Book: ERROR: Unhandled exception



What's going on there!?

Click image for larger version

Name:	ERROR: Unhandled exception.png
Views:	260
Size:	40.4 KB
ID:	153949
ERROR: Unhandled exception

Error Report
Quote:
calibre, version 2.76.0
ERROR: Unhandled exception: <b>IndexError</b>:no such group

calibre 2.76 embedded-python: True is64bit: True
Linux-4.4.0-57-generic-x86_64-with-debian-stretch-sid Linux ('64bit', 'ELF')
('Linux', '4.4.0-57-generic', '#78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016')
Python 2.7.9
Linux: ('debian', 'stretch/sid', '')
Successfully initialized third party plugins: DeDRM (6, 0, 8) && Diaps Editing Toolbag (0, 3, 2) && Wiki Reader (2, 1, 0) && Hello World Plugin (1, 0, 0)
Traceback (most recent call last):
File "site-packages/calibre/gui2/tweak_book/boss.py", line 946, in search
File "site-packages/calibre/gui2/tweak_book/search.py", line 1434, in run_search
File "site-packages/calibre/gui2/tweak_book/search.py", line 1358, in do_replace
File "site-packages/calibre/gui2/tweak_book/editor/widget.py", line 303, in replace
File "site-packages/calibre/gui2/tweak_book/editor/text.py", line 502, in replace
IndexError: no such group
chaot is offline   Reply With Quote
Old 01-04-2017, 12:35 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I saw no captures ( ) in search
also when searching for REGEX controls they need to be escaped:

\\1 through
\. \. \.

and there may be a bug as I would have expected 'Not Found' instead of a crash
theducks is online now   Reply With Quote
Advert
Old 01-04-2017, 12:46 PM   #3
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,080
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by theducks View Post
I saw no captures ( ) in search
also when searching for REGEX controls they need to be escaped:

\\1 through
\. \. \.

and there may be a bug as I would have expected 'Not Found' instead of a crash
What the Ducks said also you forgot to use Regex search mode.

bernie
gbm is offline   Reply With Quote
Old 01-04-2017, 01:08 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by gbm View Post
What the Ducks said also you forgot to use Regex search mode.

bernie


he is doing a Normal search and a Normal replace

There are no captures and \1 is just literal
theducks is online now   Reply With Quote
Old 01-04-2017, 08:02 PM   #5
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,080
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by theducks View Post


he is doing a Normal search and a Normal replace

There are no captures and \1 is just literal
By habit I just use Regex when REGEX controls are involved.


bernie
gbm is offline   Reply With Quote
Advert
Old 01-04-2017, 10:00 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: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Normal searches are converted into regexes internally, so you have to use a double backslash in the replace expression, i.e. use

\\1 -
kovidgoyal is offline   Reply With Quote
Old 01-05-2017, 03:55 AM   #7
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Special characters (so-called metacharacters) are certain characters with special meanings and have to be escaped with a backslash, if used as literal character.

There are 12 metacharacters, backslash \ is one of them.

(Escaping rules can get tricky. I didn't test the other 11 mCH.)

Last edited by chaot; 01-05-2017 at 11:06 AM. Reason: delete: it's not that important. [reason: could be misunderstood]
chaot is offline   Reply With Quote
Old 01-05-2017, 09:19 AM   #8
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
Normal searches are converted into regexes internally, so you have to use a double backslash in the replace expression, i.e. use

\\1 -
I didn't know that either. Is it in the manual?

Possibly when a user is in [Normal] search mode and enters a backslash or other escape-able character, Calibre could change the search and replace terms internally to be compatible with he internal RE engine?

Not knowing the 'trick' could lead to a lot of head scratching

Last edited by phossler; 01-05-2017 at 09:24 AM.
phossler is offline   Reply With Quote
Old 01-05-2017, 11:16 AM   #9
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
I don't know if that can help you, but: calibre is written in Python (rather sure), so things get handled the special 'Python' way. Look here → Strings, Backslashes and Regular Expressions

Last edited by chaot; 01-05-2017 at 12:58 PM. Reason: replace: 99% → rather
chaot is offline   Reply With Quote
Old 01-05-2017, 11:17 AM   #10
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: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by phossler View Post
I didn't know that either. Is it in the manual?

Possibly when a user is in [Normal] search mode and enters a backslash or other escape-able character, Calibre could change the search and replace terms internally to be compatible with he internal RE engine?

Not knowing the 'trick' could lead to a lot of head scratching
It already does for search strings, just not for replace strings, because it is pretty rare, basically only \<digit> and a couple of other forms are special.
kovidgoyal 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
Unhandled Exception Error KyBunnies Calibre 21 03-28-2015 03:20 AM
ERROR: Unhandled exception KyBunnies Devices 8 12-22-2014 03:17 PM
error: Unhandled exception library addict Calibre 4 08-28-2013 06:41 AM
Unhandled Exception Error Mi3ke Calibre 0 06-03-2012 09:43 PM
Unhandled exception error in Sidux no.guru Calibre 2 06-23-2009 03:03 PM


All times are GMT -4. The time now is 11:48 AM.


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