diff --git a/Lib/io.py b/Lib/io.py
index a205e00575f7e87df830a88c78189d8075977bad..a4186499c647153ca909f576870d885059488cfc 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -70,7 +70,7 @@ def __getattr__(name):
         global OpenWrapper
         OpenWrapper = open
         return OpenWrapper
-    raise AttributeError("module {__name__!r} has no attribute {name!r}")
+    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
 
 
 # Pretend this exception was created here.
diff --git a/Misc/NEWS.d/next/Library/2022-09-08-23-23-24.gh-issue-96700.J0MQGK.rst b/Misc/NEWS.d/next/Library/2022-09-08-23-23-24.gh-issue-96700.J0MQGK.rst
new file mode 100644
index 0000000000000000000000000000000000000000..5218f98cfea645dbbb28d4e9eaf9e048c4c907c7
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-09-08-23-23-24.gh-issue-96700.J0MQGK.rst
@@ -0,0 +1 @@
+Fix incorrect error message in the :mod:`io` module.