Skip to content

gdb-pretty-print not working with python < 3.9, because of removeprefix #4691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 2 tasks
bitFiedler opened this issue Mar 17, 2025 · 2 comments · Fixed by #4693
Closed
1 of 2 tasks

gdb-pretty-print not working with python < 3.9, because of removeprefix #4691

bitFiedler opened this issue Mar 17, 2025 · 2 comments · Fixed by #4693
Labels
kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@bitFiedler
Copy link
Contributor

Description

If gdb uses python version < 3.9 the pretty printer do not work because of the missing implementation of 'removeprefix'.

This function is only available since python version 3.9.

I can reproduce this bug by using latest version of CLion 2024.3.4, because they are using python version 3.8.

Reproduction steps

try to pretty print nlohmann object.
that occurs in an exception because the string obj do not have a function called removeprefix

Expected vs. actual results

pretty print should work if python version is < 3.9

Minimal code example

Error messages

Compiler and operating system

linux, CLion 2024.3.4

Library version

latest from branch develop

Validation

@bitFiedler
Copy link
Contributor Author

I do have a patch for the problem or can I push the fix in a branch?

@nlohmann
Copy link
Owner

Sure, please open a PR.

@nlohmann nlohmann linked a pull request Mar 18, 2025 that will close this issue
@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Mar 18, 2025
@nlohmann nlohmann added this to the Release 3.11.4 milestone Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants