[PR #171] [MERGED] Fix: f-string bug in Python 3.11 #192

Closed
opened 2026-05-07 00:19:07 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/171
Author: @AmanPathakGitHub
Created: 1/16/2026
Status: Merged
Merged: 1/18/2026
Merged by: @IAmTomShaw

Base: mainHead: fstring_bug_fix


📝 Commits (1)

  • b2d4c34 fixed fstring bug in python 3.11

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/f1_data.py (+1 -1)

📄 Description

Problem

A SyntaxError occurs in Python 3.11 due to a f-string that contains unescaped double quotes. This line is valid in Python 3.12+, but crashes in 3.11.

Solution

To maintain Python 3.11 compatibility, the f-string should use single quotes inside the braces.
If the project prefers to use double quotes in f-strings, the minimum Python version should be updated to 3.12+ in the README.

This PR applies a single quote fix to make the code run on 3.11.
An alternative solution would be to escape the double quotes inside the f-string, e.g. {session.get_driver(driver_code)\"FullName\"]}, which also works in 3.11.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/171 **Author:** [@AmanPathakGitHub](https://github.com/AmanPathakGitHub) **Created:** 1/16/2026 **Status:** ✅ Merged **Merged:** 1/18/2026 **Merged by:** [@IAmTomShaw](https://github.com/IAmTomShaw) **Base:** `main` ← **Head:** `fstring_bug_fix` --- ### 📝 Commits (1) - [`b2d4c34`](https://github.com/IAmTomShaw/f1-race-replay/commit/b2d4c34d26da1a7233f234de84b9814037a4f755) fixed fstring bug in python 3.11 ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/f1_data.py` (+1 -1) </details> ### 📄 Description # Problem A ``SyntaxError`` occurs in Python 3.11 due to a f-string that contains unescaped double quotes. This line is valid in Python 3.12+, but crashes in 3.11. # Solution To maintain Python 3.11 compatibility, the f-string should use single quotes inside the braces. If the project prefers to use double quotes in f-strings, the minimum Python version should be updated to 3.12+ in the README. This PR applies a single quote fix to make the code run on 3.11. An alternative solution would be to escape the double quotes inside the f-string, e.g. ``{session.get_driver(driver_code)\"FullName\"]}``, which also works in 3.11. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:19:07 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#192
No description provided.