Package: podman-compose
Version: 1.3.0-1
Severity: important
Tags: upstream


Running podman compose -f dir/docker-compose.yml down fails, as the
code is executing a chdir to "dir" before trying to open 
"dir/docker-compose.yml".

This produces an error:
```
>>>> Executing external compose provider "/usr/bin/podman-compose". Please see 
>>>> podman-compose(1) for how to disable this message. <<<<

Traceback (most recent call last):
  File "/usr/bin/podman-compose", line 33, in <module>
    sys.exit(load_entry_point('podman-compose==1.3.0', 'console_scripts', 
'podman-compose')())
             
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 3711, in main
    asyncio.run(async_main())
    ~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/base_events.py", line 719, in 
run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 3707, in 
async_main
    await podman_compose.run()
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 1859, in run
    self._parse_compose_file()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/podman_compose.py", line 1954, in 
_parse_compose_file
    with open(filename, "r", encoding="utf-8") as f:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'dir/docker-compose.yml'
Error: executing /usr/bin/podman-compose -f dir/docker-compose.yml down: exit 
status 1
```

while the previous version of podman-compose ran successfully.

Note that this can be workarounded using:
```
podman compose -f "$(pwd)/dir/docker-compose.yml" down
```

The offending line of code actually has a comment about it being wrong:
```
        # TODO: remove next line
        os.chdir(dirname)
```

The problem seems to be solved in 1.4.0.

Happy hacking,

-- System Information:
Debian Release: trixie/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.25-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages podman-compose depends on:
ii  python3         3.13.3-1
ii  python3-dotenv  1.0.1-1
ii  python3-yaml    6.0.2-1+b2

Versions of packages podman-compose recommends:
ii  podman  5.4.2+ds1-1+b1

podman-compose suggests no packages.

-- no debconf information

-- 
"Executive ability is deciding quickly and getting somebody else to do the
work."
-- Pollard's Postulate
Saludos /\/\ /\ >< `/

Attachment: signature.asc
Description: PGP signature

Reply via email to