Skip to content

Fix f-string syntax errors in fan_widget.py and main_window.py - #7

Open
kmilodenisglez wants to merge 1 commit into
nbfc-linux:mainfrom
kmilodenisglez:fix/python-312-fstring-syntax-error
Open

Fix f-string syntax errors in fan_widget.py and main_window.py#7
kmilodenisglez wants to merge 1 commit into
nbfc-linux:mainfrom
kmilodenisglez:fix/python-312-fstring-syntax-error

Conversation

@kmilodenisglez

Copy link
Copy Markdown

Summary

Fixes a SyntaxError: f-string: unmatched '[' occurring on Python 3.12 and newer versions due to quote reuse within f-string expressions.

Context & Cause

Starting with Python 3.12, the new f-string parser strictly validates quote nesting. Using the same single quote type for both the enclosing f-string and the dictionary key lookup (f'{fan_data['Temperature']:.2f}') throws a syntax error at launch.

Changes Made

  • Changed the internal dictionary key lookup single quotes to double quotes ("Temperature") on line 1058 of nbfc-qt.

Testing

  • Tested locally on Python 3.12+ / Linux. The application now launches and renders the temperature UI label without throwing a SyntaxError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant