Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`dond` error in finally block

Open
#4,843 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start in qcodes/dataset/dond/do_nd.py at the finally block around line 738, and trace how datasavers is assigned inside the try block. Reproduce an exception before that assignment and confirm the fix prevents UnboundLocalError while preserving the intended finally-block cleanup behavior.

Written by the indexing model from the issue text.

Description

finally block in dond (here) relies on a parameter from try block.
This results in an UnboundLocalError when the exception happens before datasavers is assigned.

    try:
        with _catch_interrupts() as interrupted, ExitStack() as stack, params_meas_caller as call_params_meas:
            datasavers = [
                stack.enter_context(group.measurement_cxt.run())
                for group in measurements.groups
            ]
        ...
    finally:
        for datasaver in datasavers:
            ...
Dominant language
Python
Stars
459
Forks
361
Avg merge
2d 10h
Merged PRs (30d)
79

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/Qcodes

All issues in microsoft/Qcodes

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.