google / aiyprojects-raspbian

API libraries, samples, and system images for AIY Projects (Voice Kit and Vision Kit)
https://aiyprojects.withgoogle.com/
Apache License 2.0
1.63k stars 694 forks source link

Fixed auth_helpers.py to work with Python 3.7 #706

Open daOrangePeeler opened 4 years ago

daOrangePeeler commented 4 years ago

This commit fixes a bug where the web browser doesn't open properly because of improper syntax for Python 3.7. The improper call of webbrowser.register in auth_helpers.py causes the entire authentication to fail, which prevents the user from starting any of the example programs. This only happens when the user tries to authenticate using the desktop interface. When the user uses ssh, the problem is avoided.

The change in auth_helpers.py is on line 75 and the last argument is changed from "-1" to "preferred=True." The documentation explains that the last argument takes boolean values instead of numeric values. This comment also explains how to implement the fix.

Resolves #658.