The module has a test which you can run like this:
Code:
$ calibre-debug /home/eschwartz/git/calibre/src/calibre/ebooks/oeb/polish/create.py /tmp/foo.txt
Traceback (most recent call last):
File "/usr/local/calibre-3/bin/calibre-debug", line 20, in <module>
sys.exit(main())
File "/home/eschwartz/git/calibre/src/calibre/debug.py", line 349, in main
run_script(args[1], args[2:])
File "/home/eschwartz/git/calibre/src/calibre/debug.py", line 261, in run_script
exec_path(ef, g)
File "/home/eschwartz/git/calibre/src/polyglot/builtins.py", line 103, in exec_path
exec(code, ctx)
File "/home/eschwartz/git/calibre/src/calibre/ebooks/oeb/polish/create.py", line 126, in <module>
create_book(mi, path, fmt=ext)
File "/home/eschwartz/git/calibre/src/calibre/ebooks/oeb/polish/create.py", line 45, in create_book
f.write(mi.title)
TypeError: a bytes-like object is required, not 'str'
https://github.com/kovidgoyal/calibre/pull/1085