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

nvwave.playWaveFile/Python 3 syntax: async is no longer accepted as a variable name, throws SyntaxError in Python 3.7 #8607

Closed
josephsl opened this issue Aug 8, 2018 · 2 comments
Labels
Python 3
Milestone

Comments

@josephsl
Copy link
Collaborator

josephsl commented Aug 8, 2018

Hi,

Continuing work on researching Python 3 transition barriers:

Background:

Python 3.5 introduces async and await keywords for working with asynchronous generators and other possibilities. However, this poses a syntax issue for NVDA: nvwave.playWaveFile has "async" keyword, which, when run with Python 3.7, produces SyntaxError.

Steps to reproduce:

  1. Run Python 2.7 and 3.7 interpreters.
  2. Run the below code in both interpreters.

Code fragment:

async = True

Actual behavior:

In 2.7, the code works, but in 3.7, SyntaxError is raised.

Expected behavior:

Code should work in 3.7.

System configuration:

NVDA Installed/portable/running from source:

Not applicable

NVDA version:

Not applicable

Windows version:

Windows 10 Version 1803

Name and version of other software in use when reproducing the issue:

Python 2.7, 3.7

Other information about your system:

N/A

Other questions:

Does the issue still occur after restarting your PC?

Yes

Have you tried any other versions of NVDA?

N/A

Possible solution:

One possible solution is to rename the keyword "async" to "_async" or "asynchronous". I would vote for the latter option as it is a bit clear as to what that keyword does.

Impact:

Any module (including add-ons) that calls nvwave.playWaveFile with "async" set to True must now use the proposed keyword argument name, breaking compatibility with old NVDA releases.

Thanks.

@josephsl josephsl changed the title nvware.playWaveFile/Python 3 syntax: async is no longer accepted as a variable name, throws SyntaxError in Python 3.7 nvwave.playWaveFile/Python 3 syntax: async is no longer accepted as a variable name, throws SyntaxError in Python 3.7 Aug 8, 2018
@josephsl josephsl added the Python 3 label Aug 8, 2018
@leonardder
Copy link
Collaborator

leonardder commented Aug 8, 2018

I vote for "asynchronous"

josephsl added a commit to josephsl/nvda that referenced this issue Aug 10, 2018
Python 3.5 introduces 'async' and 'await' keywords to deal with asynchronous generators and other possibiliites. Since Python 3.7, use of these keywords as variable names is no longer allowed. In NVDA code, nvWave.playWaveFile is affected, so rename 'async' to 'asynchronous'.
josephsl added a commit to josephsl/nvda that referenced this issue Aug 17, 2018
Python 3.5 introduces 'async' and 'await' keywords to deal with asynchronous generators and other possibiliites. Since Python 3.7, use of these keywords as variable names is no longer allowed. In NVDA code, nvWave.playWaveFile is affected, so rename 'async' to 'asynchronous'.
@leonardder leonardder added this to To do in Update NVDA to Python 3 via automation Dec 11, 2018
@leonardder leonardder moved this from To do to In progress in Update NVDA to Python 3 Dec 13, 2018
josephsl added a commit to josephsl/nvda that referenced this issue Jun 6, 2019
Python 3.5 introduces 'async' and 'await' keywords to deal with asynchronous generators and other possibiliites. Since Python 3.7, use of these keywords as variable names is no longer allowed. In NVDA code, nvWave.playWaveFile is affected, so rename 'async' to 'asynchronous'.
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Jun 6, 2019
michaelDCurran pushed a commit that referenced this issue Jun 6, 2019
* nvWave.playWaveFile: async > asynchronous. Re #8607.

Python 3.5 introduces 'async' and 'await' keywords to deal with asynchronous generators and other possibiliites. Since Python 3.7, use of these keywords as variable names is no longer allowed. In NVDA code, nvWave.playWaveFile is affected, so rename 'async' to 'asynchronous'.

* nvwave.playWaveFile: document 'asynchronous' keyword.

Reviewed by Leonard de Ruijter (Babbage): document the renamed keyword arg.

* Speech commands: async -> asynchronous.

* nvwave.playWaveFile: correct argument name in docstring.
@feerrenrut
Copy link
Member

feerrenrut commented Jun 13, 2019

Fixed with #8647

Update NVDA to Python 3 automation moved this from In progress to Done Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python 3
Projects
No open projects
Development

No branches or pull requests

4 participants