%q format specifier is invalid
According to Chapter-7.rst, there should be a format specifier %q which results in the string being between quotes with special characters escaped (equivalent to string.escape as I understand). When I run the following code it says invalid option '%q' to 'format'.
import string
print(string.format("%q","test"))
This is a documentation bug. It was never implemented. You should use %q with json.dump() as a replacement.
I will check however if it's easy to add
On 2023-07-09 I removed the unimplemented %q from the wiki markdown page Chapter 7, which seems to be where the most recent docs are, instead of the .rst files in docs/source/en.
%q is now supported, short manual and documentation have been updated