Got same problem as Leonatus, after long time trying to solve problem, uninstalled Calibre, then installed again, and > it's working!

If you connect your Kobo Glo, plugin is working, but after Calibre restart got same problem, so the best way to solve this is to uninstall > install Calibre > convert all you need to .kepub.

Hope this solution will help to resolve all problems, test it and reply please.

The driver shouldn't just stop working. If it does, it would be better to work out why than just uninstalling reinstalling calibre. It's very likely there was an error somewhere along the way that wasn't displayed. Running calibre in debug mode will show these errors. Or, if there is error, give a view of what is actually happening.

Cleaning markup for file titlepage.xhtml
Copying file 'C:\CalibreData\Temporary\calibre_wmp8hz\kepub_myx8u6_hyphenate' to 'C:\CalibreData\Temporary\calibre_wmp8hz\bqdh7w_epub_container' as 'kte-css/hyphenation.css'
Adding reference to kte-css/hyphenation.css to file OEBPS/html/00_FM.xhtml
C:\Program Files\Calibre2\pylib.zip\ntpath.py:532: UnicodeWarning: Unicode unequal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
Python function terminated unexpectedly
All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters (Error Code: 1)
Traceback (most recent call last):
File "site.py", line 132, in main
File "site.py", line 109, in run_entry_point
File "site-packages\calibre\utils\ipc\worker.py", line 195, in main
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 33, in gui_convert_override
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 26, in gui_convert
File "site-packages\calibre\ebooks\conversion\plumber.py", line 1252, in run
File "calibre_plugins.kepubout.conversion.kepub_output", line 131, in convert
File "calibre_plugins.kepubout.common", line 103, in modify_epub
File "calibre_plugins.kepubout.container", line 178, in add_content_file_reference
File "lxml.etree.pyx", line 1445, in lxml.etree._Element.makeelement (src\lxml\lxml.etree.c:49848)
File "apihelpers.pxi", line 133, in lxml.etree._makeElement (src\lxml\lxml.etree.c:14869)
File "apihelpers.pxi", line 121, in lxml.etree._makeElement (src\lxml\lxml.etree.c:14748)
File "apihelpers.pxi", line 268, in lxml.etree._initNodeAttributes (src\lxml\lxml.etree.c:16296)
File "apihelpers.pxi", line 290, in lxml.etree._addAttributeToNode (src\lxml\lxml.etree.c:16701)
File "apihelpers.pxi", line 1395, in lxml.etree._utf8 (src\lxml\lxml.etree.c:26485)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters

The marked line is where the error is happening. It's something related to the locale or some character used in the user profile name and hence the users directories including the temporary directory. There is a discussion on this ending on the previous page. The workaround is to set the environment variable "CALIBRE_TEMP_DIR" to somewhere else.

I added "&ndash;" after each dash, this is the right thing to do, right? If so, it does not work, I have the same problem, extra spaces when the text is justified

I was sure it worked but, testing on my kobo, it doesn't sorry (I was talking about adding an emspace or an enspace, but it doesn't work).
I had never seen it before, but it seems I've got the same problem when I send the epub as kepub. (the justification in kepub seems to create a space between emdash and a word even if there is no space)

How can I fix it ? I assume that I have to edit the CSS, but which line ?

You could try adding...

orphans: 1;
widows: 1;

to the body in CSS. That would prevent some lines from being moved to the next page even when there is room. It looks like that's what's happening. If there is still extra space, you can use the patches to remove the extra space. Which Kobo do you have?

I solved the problem of another book this morning by randomly changing the CSS, but I can't tell which line has solved the problem : it's definitely possible
It was a CSS of 2000 lines, I believe I removed all text-indent and margins then add paragraph break. But I did not manage to do it again