Viewer Crashes on "Invalid IPv6 URL"

Bug #1858836 reported by Jim Miller on 2020-01-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

A bad URL in an <a> tag in ebook can cause the Viewer to crash on viewer start.

The example I stumbled across was:

<a href="http://Tianjin–Pukou Railway Operation[/url">...</a>

(Epub example attached--also happened in azw3.)

Only happens in viewer; convert, edit book, polish all handle it fine.

The best way to fix it wasn't obvious to me, so I'm reporting it instead of trying to fix it.

These are similar bugs in the past, if it helps:
https://bugs.launchpad.net/calibre/+bug/1429282
https://bugs.launchpad.net/calibre/+bug/902372

Full error:

calibre, version 4.8.0
ERROR: Loading book failed: Failed to open the book at C:\Users\USER\Desktop\Demo of Viewer Error - Demo.epub. Click "Show details" for more info.

Traceback (most recent call last):
  File "site-packages\calibre\gui2\viewer\ui.py", line 371, in _load_ebook_worker
  File "site-packages\calibre\gui2\viewer\convert_book.py", line 234, in prepare_book
  File "site-packages\calibre\gui2\viewer\convert_book.py", line 191, in do_convert
ConversionFailure: Failed to convert book: C:\Users\USER\Desktop\Demo of Viewer Error - Demo.epub with error:
InputFormatPlugin: EPUB Input running
on C:\Users\USER\Desktop\Demo of Viewer Error - Demo.epub
Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
Python function terminated unexpectedly
  Invalid IPv6 URL (Error Code: 1)
 Traceback (most recent call last):
  File "site.py", line 114, in main
  File "site.py", line 88, in run_entry_point
  File "site-packages\calibre\utils\ipc\worker.py", line 189, in main
  File "<string>", line 1, in <module>
  File "site-packages\calibre\srv\render_book.py", line 848, in viewer_main
  File "site-packages\calibre\srv\render_book.py", line 841, in render_for_viewer
  File "site-packages\calibre\srv\render_book.py", line 820, in render
  File "site-packages\calibre\srv\render_book.py", line 655, in process_exploded_book
  File "site-packages\calibre\srv\render_book.py", line 486, in __call__
  File "site-packages\calibre\srv\render_book.py", line 577, in process_book_files
  File "site-packages\calibre\srv\render_book.py", line 421, in transform_html
  File "site-packages\calibre\srv\render_book.py", line 412, in handle_link
  File "site-packages\calibre\srv\render_book.py", line 109, in link_replacer
  File "urlparse.py", line 143, in urlparse
  File "urlparse.py", line 210, in urlsplit
ValueError: Invalid IPv6 URL

My Calibre details:

calibre 4.8 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.18362-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.18362')
Python 2.7.16+
Windows: ('10', '10.0.18362', 'SP0', u'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: View Manager (1, 5, 4) && EpubSplit (2, 8, 3) && Count Pages (1, 9, 0) && FanFicFare (3, 14, 5) && EpubMerge (2, 7, 3) && Generate Cover (1, 5, 22) && Quality Check (1, 9, 11) && Reading List (1, 6, 7) && Modify ePub (1, 4, 0) && SmartEject (2, 2, 1) && Favourites Menu (1, 0, 5) && Manage Series (1, 2, 9) && ColumnSum (2, 1, 0)

Jim Miller (retiefjimm) wrote :

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers