Fixed an I/O bug in lyx2docx that caused crashes under some Python implementations.