nvda
3c10f6d1 - Python3: Fix SAPI5 and MSSP on installed NVDA (PR #9964)

Commit
6 years ago
Python3: Fix SAPI5 and MSSP on installed NVDA (PR #9964) SAPI5 was not working on installed copies NVDA because dllImportTableHooks_hookSingle was getting wide strings, not byte strings. Changing from SAPI5 to another synthesiser still showed the SAPI5 voices in the list of voices. Now expect Python 3 (unicode) strings, and encode to mbcs/ANSI. This is required because in nvdaHelper/local/dllImportTableHooks.cpp we are using ANSI functions, which should probably change in the future, but for now we need to ensure that these strings are no more than ANSI strings. If the encode fails, which we don't currently expect, the error is logged. Also add protections in __del__ method self._hook is not set, if there is some failure in the initialisation. Also fix a circular reference with the SAPI5 event sink.
Author
Committer
Parents
Loading