Skip to content
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

Fix dict modifying error #169

Merged
merged 1 commit into from
Jun 20, 2023
Merged

Conversation

felixfontein
Copy link
Collaborator

The construct

try:
  foo[bar]...
except KeyError:
  ...

is dangerous: if foo is a defaultdict, you end up with a new entry, instead of the except handler being executed. In case of docs augmentation, this can lead to a crash if a seealso without description is present for a non-existing plugin/module.

@felixfontein felixfontein added the backport-1 Automatically create backport to stable-1 branch label Jun 20, 2023
@felixfontein
Copy link
Collaborator Author

This was crashing the tests while working on #168.

@patchback
Copy link

patchback bot commented Jun 20, 2023

Backport to stable-1: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-1/c2a176dc7de5c55ddb79e0725a448c1fe954f65c/pr-169

Backported as #170

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein deleted the fix branch June 20, 2023 19:37
patchback bot pushed a commit that referenced this pull request Jun 20, 2023
(cherry picked from commit c2a176d)
felixfontein added a commit that referenced this pull request Jun 21, 2023
(cherry picked from commit c2a176d)

Co-authored-by: Felix Fontein <felix@fontein.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-1 Automatically create backport to stable-1 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant