[copy] TypeError: string indices must be integers
Metadata
Current evaluation
Moved to canonical/snapcraft#41; scalar copy-plugin files handling was fixed by merged PR canonical/snapcraft#108, which added glob support.
Resolution: closed resolved
Reason: The Launchpad report was closed after being moved to canonical/snapcraft#41. That issue was resolved by merged PR canonical/snapcraft#108, adding glob support for the copy plugin's files option.
Evaluated by: mr-cal-bot
No scores available.
Issue body
I'm sure I'm using it wrong, bug snapcraft shouldn't crash:
name: bwm-ng
version: 0.6-3.2
vendor: Daniel Holbach <email address hidden>
summary: small and simple console-based bandwidth monitor
description:
Bandwidth Monitor NG is a small and simple console-based live network and
disk io bandwidth monitor for Linux, BSD, Solaris, Mac OS X and others
icon: ubuntu.png
binaries:
bwm-ng:
exec: usr/bin/bwm-ng
parts:
bwm-ng:
type: copy
files: .
stage-packages: [bwm-ng]
aniel@daydream:~/dev/apps/bwm-ng.snap$ snapcraft build
Skipping pull bwm-ng (already ran)
Building bwm-ng
Traceback (most recent call last):
File "/usr/bin/snapcraft", line 33, in <module>
snapcraft.main.main()
File "/usr/lib/python3/dist-packages/snapcraft/main.py", line 80, in main
args.func(args)
File "/usr/lib/python3/dist-packages/snapcraft/cmds.py", line 331, in cmd
if not getattr(part, cmd)(force=force):
File "/usr/lib/python3/dist-packages/snapcraft/plugin.py", line 208, in build
if not getattr(self.code, 'build')():
File "/usr/lib/python3/dist-packages/snapcraft/plugins/copy.py", line 31, in build
dst = self.options.files[src]
TypeError: string indices must be integers
daniel@daydream:~/dev/apps/bwm-ng.snap$
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Moved to canonical/snapcraft#41; scalar copy-plugin files handling was fixed by merged PR canonical/snapcraft#108, which added glob support. | |
| stealth/space-bunny-alpha | — | closed resolved | Copy plugin crashed with TypeError on scalar `files: .`; fixed by merged PR canonical/snapcraft#108 ("copy plugin: Support globs", commit 8294647d6) which added glob/scalar handling to the copy plugin. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as invalid configuration, not a code fix: `files: .` supplies a string where the copy plugin expects a source-to-destination mapping. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as user error: the copy plugin expected a source-to-destination mapping, but files was a list, triggering the TypeError. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The crash resulted from defining the files option as a string rather than a list. Changing the YAML syntax to files: [.] resolves the TypeError. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed and closed. The copy plugin crashed with a TypeError when the files option was a string. The code was updated to handle string inputs, resolving the crash. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without comment or resolution details. The report describes a TypeError crash in Snapcraft's copy plugin when processing a snapcraft.yaml configuration. Likely abandoned or resolved internally. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after reporting a TypeError crash in the copy plugin when files is a string. The bug was fixed by correcting type handling in the plugin. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution after reporting a snapcraft copy plugin crash that raised a TypeError when indexing files. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Duplicate Of:
canonical/snapcraft#41
(confidence 100%)
A maintainer moved this Launchpad report to GitHub issue #41.
-
Likely Fixed By:
canonical/snapcraft#108
(confidence 98%)
The merged PR added glob support that fixed scalar files: . handling.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #41 [copy] TypeError: string indices must be integers | snapcraft | closed | Copy plugin scalar `files: .` handling was fixed by merged PR #108, which added glob support. | |
| #1478054 copy plugin doesn't support globs | snapcraft (launchpad) | closed | Launchpad bug 1478054 (copy plugin lacks src glob support) was migrated to GitHub issue ubuntu-core/snapcraft#26 and fixed by merged PR #108, commit 8294647d6, which replaced cp with Python glob calls and added a unit test. |