Skip to content
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

Credicle bug of this dictionary. #4834

Closed
nvaccessAuto opened this issue Jan 20, 2015 · 8 comments
Closed

Credicle bug of this dictionary. #4834

nvaccessAuto opened this issue Jan 20, 2015 · 8 comments
Labels
bug/startup-crash bug component/speech p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Milestone

Comments

@nvaccessAuto
Copy link

Reported by vgjh2005 on 2015-01-20 08:14
Hi:
This dic file include errors, and put it in speechdic folder, Press CTRL+ALT+N to restart NVDA, NVDA will not start again at all. There are also no error information. Thanks!

@nvaccessAuto
Copy link
Author

Attachment default.dic added by vgjh2005 on 2015-01-20 08:15
Description:

@nvaccessAuto
Copy link
Author

Comment 1 by chrislm on 2015-01-20 09:34
Please check your default.dic in line 41.
Error: unbalanced parenthesis

@nvaccessAuto
Copy link
Author

Comment 2 by vgjh2005 on 2015-01-20 10:18
Hi:
Yes. you're right. This isn't my point. My point is that NVDA cannot launch correctly. I can hear a error sound, and NVDA isn't launched. I have made more times for this. Thanks!

@nvaccessAuto
Copy link
Author

Comment 3 by jteh on 2015-01-20 10:40
Changes:
Milestone changed from None to next

@nvaccessAuto nvaccessAuto added this to the next milestone Nov 10, 2015
@jcsteh jcsteh removed this from the next milestone Jun 24, 2016
@feerrenrut
Copy link
Contributor

default.dic.txt

The attachment referenced, just remove the .txt extension.

@feerrenrut
Copy link
Contributor

Trace from log:

Traceback (most recent call last):
  File "nvda.pyw", line 190, in <module>
    core.main()
  File "core.py", line 198, in main
    speechDictHandler.initialize()
  File "speechDictHandler.py", line 108, in initialize
    dictionaries["default"].load(os.path.join(speechDictsPath, "default.dic"))
  File "speechDictHandler.py", line 70, in load
    self.append(SpeechDictEntry(temp[0].replace(r'\#','#'),temp[1].replace(r'\#','#'),comment,bool(int(temp[2])),int(temp[3])))
  File "speechDictHandler.py", line 37, in __init__
    self.compiled = re.compile(tempPattern,flags)
  File "C:\Python27\lib\re.py", line 194, in compile
    return _compile(pattern, flags)
  File "C:\Python27\lib\re.py", line 251, in _compile
    raise error, v # invalid expression
error: unbalanced parenthesis

@feerrenrut feerrenrut self-assigned this Jul 1, 2016
@feerrenrut
Copy link
Contributor

This can also be reproduced by adding a new entry through the GUI

  • Open default dictionary settings.
  • Click add
  • fill in the fields, use an invalid regular expression for the pattern (eg unbalanced parenthesis)
  • ensure that the reg ex option is selected
  • click ok.

@jcsteh
Copy link
Contributor

jcsteh commented Jul 1, 2016 via email

@nvaccessAuto nvaccessAuto added the p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority label Jul 5, 2016
feerrenrut added a commit that referenced this issue Jul 20, 2016
)

Fixes #4834
PR: #6136 

This change introduces a safety check when loading speech dictionaries, to ensure that nvda does not crash if the dictionaries contain invalid regex. This change also catches the same situation in the UI and informs the user that the regex is invalid.

- When adding a dictionary entry with invalid regex, the error message now states that this is a regex error and qoutes the error. It is unfortunate, but the regex error is difficult to translate.
- If a user does manage to introduce an error into a dictionary file, then the nvda will import all valid lines in the file, reporting warnings to the log for lines in the dictionary that are invalid.
feerrenrut added a commit that referenced this issue Jul 20, 2016
When editing dictionary entries, feedback is now given for invalid regular expressions. NVDA no longer crashes if a dictionary file contains an invalid regular expression.
@jcsteh jcsteh added this to the 2016.3 milestone Aug 5, 2016
@feerrenrut feerrenrut removed their assignment Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/startup-crash bug component/speech p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
Projects
None yet
Development

No branches or pull requests

3 participants