Nowadays most Python libraries tend to accept objects implementing the
os.PathLike abstract base class where they accept file names. The
apt_pkg functions that go through PyApt_Filename don't seem to. Here's
a contrived example:
>>> from pathlib import Path
>>> import apt_pkg
>>> release_path = Path("/var/lib/apt/lists/deb.debian.org_debian_dists_trixie_InRelease")
>>> apt_pkg.open_maybe_clear_signed_file(release_path)
Traceback (most recent call last):
File "<python-input-4>", line 1, in <module>
apt_pkg.open_maybe_clear_signed_file(release_path)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
SystemError: argument 1 (unspecified)
>>> apt_pkg.open_maybe_clear_signed_file(release_path.as_posix())
6
It would be nice if this worked.
Thanks,