Skip to content

fix: escape percent sign in argparse help string#457

Open
Bahtya wants to merge 1 commit intoallenai:mainfrom
Bahtya:fix/argparse-help-percent
Open

fix: escape percent sign in argparse help string#457
Bahtya wants to merge 1 commit intoallenai:mainfrom
Bahtya:fix/argparse-help-percent

Conversation

@Bahtya
Copy link
Copy Markdown

@Bahtya Bahtya commented Apr 8, 2026

Problem

Running python -m olmocr.bench.benchmark --dir ... crashes with:

ValueError: unsupported format character 'C' (0x43) at index 65

The argparse help string for --confidence_level contains 95% CI. Python's argparse uses %-formatting for help strings, so the literal % is interpreted as a format specifier.

Fix

Escape 95% to 95%% in the help string.

Fixes #451

The help string for --confidence_level contains a literal '%' which
argparse interprets as a format specifier, causing ValueError:
'unsupported format character C' on Python 3.14+.

Escape '95% CI' to '95%% CI' to fix the help string formatting.

Fixes allenai#451

Signed-off-by: bahtya <bahtyar153@qq.com>
@Bahtya
Copy link
Copy Markdown
Author

Bahtya commented Apr 11, 2026

Hi team, just wanted to follow up on this PR. Would appreciate any feedback!

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.

[bug] badly formed help string

1 participant