-
-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synth drivers/eSpeak NG internal: pass in a NULL pointer (path string) when obtaining eSpeak NG version string #11975
Conversation
…ersion info. Python 3.8: without passing in a path string, access violation is thrown, which can cause NVDA executable to hang when trying to obtain eSpeak NG version string. Therefore pass in NULL (None) because what NVDA is interested in is synthesizer version.
See test results for failed build of commit f155bc4941 |
source/synthDrivers/_espeak.py
Outdated
#Copyright (C) 2007-2017 NV Access Limited, Peter Vágner | ||
#This file is covered by the GNU General Public License. | ||
#See the file COPYING for more details. | ||
# synthDrivers/_espeak.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line to comply with the standard for copyright headers.
source/synthDrivers/_espeak.py
Outdated
@@ -369,7 +369,8 @@ def terminate(): | |||
onIndexReached = None | |||
|
|||
def info(): | |||
return espeakDLL.espeak_Info() | |||
# Python 3.8: a path string must be specified, a NULL is fine when what we need is version string. | |||
return espeakDLL.espeak_Info(None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this function returns bytes, and the only place in which it is used is the message in the log stating which version of eSpeak is in use have you considered decoding this to avoid leading "b" being shown in the log viewer i.e.:
return espeakDLL.espeak_Info(None).decode()
Hi, should we also remove encoding statement at the top of the file? If yes, I’ll do that while addressing comments. As for encoding from bytes to str, I’ll do that once Grep tells me it is safe to do so. Thanks.
|
Comment from Lukasz Golonka: remove file name from copyright header, use bytes.decode to transform eSpeak NG version string from bytes to Unicode.
See test results for failed build of commit 63aca1d339 |
Hi,
Needed for Python 3.8, although it is equally applicable to Python 3.7 and makes NVDA code more compliant with eSpeak NG API:
Link to issue number:
None
Summary of the issue:
eSpeak NG fails to load on Python 3.8 version of NVDA, traced to espeak.dll::espeak_Info function not receiving path string.
Description of how this pull request fixes the issue:
Pass in NULL (None) when eSepak NG asks for path string in sepak_Info function because what NVDA is interested in is eSpeak NG version string.
Testing performed:
Tested under source code and via a private binary copy:
Known issues with pull request:
None
Change log entry:
None
Impact:
This is one of the major changes required to move NVDA to Python 3.8, especially given that eSpeak NG will be set as default speech synthesizer on Windows releases other than 10.
Thanks.