Skip to content
 
 

Repository files navigation

python3-libzfs — Ubuntu 26.04 compatibility fork

This is a fork of 45Drives/python3-libzfs (taken at commit 08e8778), which is itself a packaging fork of truenas/py-libzfs.

Why this fork exists: the base does not build on my Ubuntu 26.04 (Python 3.14, Cython 3.x, OpenZFS 2.4.1). This fork adds one fix commit on top that makes it cythonize, compile, and run correctly there. No features or behaviour are changed.

What changed (summary):

  • Cython 3.x GIL/exception model — added noexcept to the cdef nogil C callbacks (zfs_iter_f, zpool_iter_f, zprop_func, the zfs_userspace_cb_t impl); Cython 3 rejects nogil callbacks without an explicit exception spec.
  • children / snapshots / bookmarks iteration on ZFSDataset now resolves the inherited ZFSResource.__iterate callback into a local before the with nogil: block, instead of referencing self.__iterate inside it — Python name-mangling across the class hierarchy made that fall through to a GIL-requiring lookup, which Cython 3 rejects.
  • Python 2 leftovers — the removed long builtin replaced with int.
  • OpenZFS 2.4.1 header drift.pxd externs and call sites updated for added const qualifiers (nvpair_value_string*, zpool_get_status, nvlist_add_*_array), zpool_add's new check_ashift parameter (call site passes False to keep prior behaviour), and the zfs_userspace_cb_t callback's new default_quota parameter (accepted and ignored, as before).

Full reasoning for every change is in CHANGES.md. Files touched: libzfs.pyx, nvpair.pxi, pxd/libzfs.pxd, pxd/nvpair.pxd.

Licensing is unchanged: BSD-2-Clause, per LICENSE. The fix commit is offered under the same license as the files it modifies.

Everything below this line is the upstream README, unchanged.


py-libzfs

Python bindings for libzfs

py-libzfs is a fairly straight-forward set of Python bindings for libzfs for ZFS on Linux and FreeBSD.

INSTALLATION

./configure && make install

FEATURES:

  • Access to pools, datasets, snapshots, properties, pool disks
  • Many others!

QUICK HOWTO:

import libzfs

Get a list of pools:

pools = list(libzfs.ZFS().pools)

Get help:

help(libzfs)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages