← Back to issue list

jhbuild fails with: 'chmod_path' referenced before assignment

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1715507
Type
issue
State
closed
Author
~elopio
Labels
—
Created
Updated
Closed

Current evaluation

UnboundLocalError in the jhbuild plugin's _setup_jhbuild (chmod_path referenced before assignment) was fixed by PR #1534, commit 67089e0 "jhbuild plugin: fix UnboundLocalError for chmod_path"; maintainer ~sergiusens closed the bug after merging.

Resolution: closed resolved

Reason: Reported autopkgtest traceback pointed at snapcraft/plugins/jhbuild.py line 288; commit 67089e050 ('jhbuild plugin: fix UnboundLocalError for chmod_path', PR #1534) initialised the variable and resolved the failure, as confirmed by ~sergiusens closing the issue citing that PR.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Running the autopkgtests for snapcraft, there is one failure in the jhbuild plugin: File "/usr/lib/python3/dist-packages/snapcraft/plugins/jhbuild.py", line 288, in _setup_jhbuild for filename in glob.iglob('%s/**' % chmod_path, recursive=True): UnboundLocalError: local variable 'chmod_path' referenced before assignment Full trace: Traceback (most recent call last): File "/usr/bin/snapcraft", line 9, in <module> load_entry_point('snapcraft==2.34', 'console_scripts', 'snapcraft')() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load return self.resolve() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/usr/lib/python3/dist-packages/snapcraft/cli/__main__.py", line 19, in <module> run(prog_name='snapcraft') File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 64, in pull _execute('pull', parts, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 31, in _execute lifecycle.execute(command, project_options, parts) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 130, in execute _Executor(config, project_options).run(step, part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 225, in run self._run_step(step, part, part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 262, in _run_step getattr(part, step)() File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 252, in pull self.plugin.pull() File "/usr/lib/python3/dist-packages/snapcraft/plugins/jhbuild.py", line 248, in pull self._setup_jhbuild() File "/usr/lib/python3/dist-packages/snapcraft/plugins/jhbuild.py", line 288, in _setup_jhbuild for filename in glob.iglob('%s/**' % chmod_path, recursive=True): UnboundLocalError: local variable 'chmod_path' referenced before assignment }}} Traceback (most recent call last): File "/tmp/autopkgtest.kW5YnH/build.YbV/snapcraft/integration_tests/plugins/test_jhbuild_plugin.py", line 94, in test_snap self.run_snapcraft(step, 'jhbuild') File "/tmp/autopkgtest.kW5YnH/build.YbV/snapcraft/integration_tests/__init__.py", line 128, in run_snapcraft env=env) File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['snapcraft', '-d', 'pull']' returned non-zero exit status 1 Full log: https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-xenial-snappy-dev-snapcraft-daily/xenial/amd64/s/snapcraft/20170906_224522_185bf@/log.gz

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved UnboundLocalError in the jhbuild plugin's _setup_jhbuild (chmod_path referenced before assignment) was fixed by PR #1534, commit 67089e0 "jhbuild plugin: fix UnboundLocalError for chmod_path"; maintainer ~sergiusens closed the bug after merging.
stealth/space-bunny-alpha — closed resolved Fixed the jhbuild plugin's uninitialized chmod_path error in snapcore/snapcraft#1534 (commit 67089e050).
stealth/space-bunny-alpha — closed resolved Fixed the jhbuild chmod_path UnboundLocalError by merging canonical/snapcraft#1534 (commit 67089e050).
qwen/qwen3.6-35b-a3b — — Fixed by initializing the chmod_path variable before use in the jhbuild plugin. Closed without comments.
qwen/qwen3.6-35b-a3b — — Closed. Reported an UnboundLocalError for chmod_path in the jhbuild plugin during autopkgtests. No resolution, merge, or follow-up comments were recorded.
qwen/qwen3.6-35b-a3b — — Closed without comments. Likely fixed by correcting the 'chmod_path' variable assignment scope in the jhbuild plugin, with no explicit resolution details provided.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution or discussion. The report documents an UnboundLocalError for chmod_path in snapcraft's jhbuild plugin during tests, indicating the bug report was abandoned.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcraft#1534 (confidence 95%)

    PR merged as commit 67089e050 'jhbuild plugin: fix UnboundLocalError for chmod_path'; cited verbatim in the closing comment by ~sergiusens.

Related issues

Issue Project State Summary Similarity
#1534 jhbuild plugin: fix UnboundLocalError for chmod_path snapcraft merged PR #1534 merged as commit 67089e050, moving the for-loop into the scope of `chmod_path` in the jhbuild plugin to fix the UnboundLocalError from LP bug #1715507.
89%