[Bug] Convert EPUB Fail (TypeError: cannot convert 'NoneType' object to bytes)

Bug #1995551 reported by polyproline
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

calibre version:
        6.7.1
python_impl:
        CPython
cpus:
        8
platform:
        win32
Computer:
        uname_result(system='Windows', node='XXXX', release='10', version='10.0.19045', machine='AMD64')
python version:
        3.10.1 (main, Dec 23 2021, 12:15:59) [MSC v.1929 64 bit (AMD64)]
flags:
        sys.flags(debug=0, inspect=0, interactive=0, optimize=2, dont_write_bytecode=1, no_user_site=1, no_site=0, ignore_environment=1, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=1, dev_mode=False, utf8_mode=1, warn_default_encoding=0)
thread_info:
        sys.thread_info(name='nt', lock=None, version=None)
qt version:
        6.3.1

ebook-convert.exe .\testNone.original_epub .epub --subset-embedded-fonts --insert-blank-line --remove-paragraph-spacing --linearize-tables --duplicate-links-in-toc --enable-heuristics --preserve-cover-aspect-ratio --epub-version 3
Conversion options changed from defaults:
  subset_embedded_fonts: True
  linearize_tables: True
  enable_heuristics: True
  remove_paragraph_spacing: True
  preserve_cover_aspect_ratio: True
  duplicate_links_in_toc: True
  insert_blank_line: True
  epub_version: '3'
1% 将输入转换为HTML中...
InputFormatPlugin: EPUB Input running
on D:\Document\test\testNone.original_epub
Parsing all content...
flow is too short, not running heuristics
flow is too short, not running heuristics
flow is too short, not running heuristics
34% 正在对电子书进行转换...
Merging user specified metadata...
Detecting structure...
        Detected chapter: Chapter 1. The Tar Pit
        .....
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Trimming 'OEBPS/html/graphics/19161.jpg' from manifest
Creating EPUB Output...
67% 正在运行 EPUB Output 插件
Rescaling image from 1000x1572 to 754x1186 OEBPS/html/graphics/f15fig04.gif
Splitting markup on page breaks and flow limits, if any...
        Looking for large trees in OEBPS/html/cover.html...
        No large trees found
        .........
The cover image has an id != "cover". Renaming to work around bug in Nook Color
Traceback (most recent call last):
  File "runpy.py", line 196, in _run_module_as_main
  File "runpy.py", line 86, in _run_code
  File "site.py", line 82, in <module>
  File "site.py", line 77, in main
  File "site.py", line 49, in run_entry_point
  File "calibre\ebooks\conversion\cli.py", line 419, in main
  File "calibre\ebooks\conversion\plumber.py", line 1281, in run
  File "calibre\ebooks\conversion\plugins\epub_output.py", line 256, in convert
  File "calibre\ebooks\conversion\plugins\oeb_output.py", line 68, in convert
  File "calibre\ebooks\oeb\base.py", line 1099, in bytes_representation
  File "calibre\ebooks\oeb\base.py", line 435, in serialize
TypeError: cannot convert 'NoneType' object to bytes

Revision history for this message
polyproline (polyproline) wrote :
description: updated
description: updated
summary: - [Bug] TypeError: cannot convert 'NoneType' object to bytes
+ [Bug] Convert EPUB Fail (TypeError: cannot convert 'NoneType' object to
+ bytes)
Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.