containers / containers/podman-compose
Unable to run any command due to `AttributeError: 'str' object has no attribute 'get'` exception
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 622
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Whenever I try to run any command under `podman-compose`, it throws an exception that `AttributeError: 'str' object has no attribute 'get'`.
**To Reproduce**
Steps to reproduce the behavior:
1. Try to run any command under `podman-compose` (for example `podman compose up`
**Expected behavior**
The command would work.
**Actual behavior**
It throws an exception.
**Output**
```
$ podman-compose up
Traceback (most recent call last):
File "/home/nexussfan/podman_compose.py", line 3554, in
main()
File "/home/nexussfan/podman_compose.py", line 3550, in main
asyncio.run(async_main())
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/nexussfan/podman_compose.py", line 3546, in async_main
await podman_compose.run()
File "/home/nexussfan/podman_compose.py", line 1773, in run
self._parse_compose_file()
File "/home/nexussfan/podman_compose.py", line 1890, in _parse_compose_file
resolved_services = self._resolve_profiles(compose.get("services", {}), set(args.profile))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nexussfan/podman_compose.py", line 2053, in _resolve_profiles
service_profiles = set(config.get("profiles", []))
^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'
```
**Environment:**
- OS: Linux (Debian 13)
- podman version: 5.2.5
- podman compose version: 122a914b9b1e278e8d062e5755ca8a602306f416
Contributor guide
Assessment
This issue has not been assessed yet.