Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#55931 - [cryptsetup] Request: use --enable-python --with-python_version=3.6

Attached to Project: Arch Linux
Opened by brent saner (sanerb) - Monday, 09 October 2017, 12:31 GMT
Last edited by Doug Newgard (Scimmia) - Monday, 09 October 2017, 15:16 GMT
Task Type Feature Request
Category Packages: Extra
Status Assigned
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Sorry, Christian; another one for ya. (i hope i don't seem ungrateful; you're a busy guy and you do good work.)

Cryptsetup also offers python bindings. unfortunately we can't build bindings for both (like we can with the proposed fix for #55930) in one go but i'd imagine if we had to choose, 3.6 would be the ideal. (otherwise i suppose you could copy the source tree and build twice, but that seems silly since python 2 EOLs in 3 years anyways). tested, patch attached.

Additional info:
More configure line links for reference:
* python enable section:
* python version specification:

Steps to reproduce:

patch confirmed working:

>>> import pycryptsetup
>>> pycryptsetup.C
pycryptsetup.CRYPT_ACTIVE pycryptsetup.CRYPT_DEBUG_ALL pycryptsetup.CRYPT_INACTIVE pycryptsetup.CRYPT_LOG_DEBUG pycryptsetup.CRYPT_LOG_NORMAL pycryptsetup.CryptSetup(
pycryptsetup.CRYPT_BUSY pycryptsetup.CRYPT_DEBUG_NONE pycryptsetup.CRYPT_INVALID pycryptsetup.CRYPT_LOG_ERROR pycryptsetup.CRYPT_LOG_VERBOSE
This task depends upon

Comment by brent saner (sanerb) - Monday, 09 October 2017, 12:34 GMT
(minor correction, because i'm a pedant- py2 EOLs in closer to 2 years than 3; 2020)
Comment by Christian Hesse (eworm) - Tuesday, 10 October 2017, 09:34 GMT
As python bindings for lvm2 are deprecated and dbus api is supposed to be used... Is there any use for python bindings for cryptsetup?
Comment by brent saner (sanerb) - Tuesday, 10 October 2017, 17:33 GMT
must have missed that line in the LVM configure...

but as for cryptsetup, i'm not so sure; all I could find related to DBUS cryptsetup implementation was via udisks:

i'm not seeing anything in the actual DBUS API, though?

pycryptsetup (the bindings provided by --enable-python) however seem to be geared specifically towards some key functionality:

>>> dir(pycryptsetup.CryptSetup)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'activate', 'addKeyByPassphrase', 'addKeyByVolumeKey', 'askyes', 'cmdLineLogCB', 'deactivate', 'debugLevel', 'info', 'isLuks', 'iterationTime', 'killSlot', 'log', 'luksFormat', 'luksUUID', 'passwordDialogCB', 'removePassphrase', 'resume', 'status', 'suspend', 'yesDialogCB']

for instance, i'm not readily seeing any DBUS/udisks equivalent for "killSlot", "resume"/"suspend", etc.
Comment by Masanori Ogino (omasanori) - Thursday, 14 March 2019, 08:03 GMT
It seems that this binding is obsoleted since cryptsetup 2.1.0.

From release notes:

> * The Python bindings are no longer supported and the code was removed
> from cryptsetup distribution. Please use the libblockdev project
> that already covers most of the libcryptsetup functionality
> including LUKS2.