`dkimpy` in Python 3 does not work for 'verify' - AttributeError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dkimpy (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Xenial |
New
|
High
|
Unassigned |
Bug Description
This is fixed in later releases of the `dkimpy` library, specifically tested was 0.6.2 to see if it's fixed.
`dkimpy` in Python 3 on Xenial *does not work* as expected when calling `verify` on a signed message in bytes form. It also fails for 'string' form, because it tries to use bytes patterns on a string object.
This affects 0.5.6-1, but is fixed in Artful and 0.6.2 already. (I'd go version by version to find a fix, but I'm not that concerned since I've already made a backport of `python3-dkim` in a PPA[1].
As this breaks one of the crucial functions (message verification with the `verify` function), I'm setting this as a "High" importance bug.
[1] https:/
description: | updated |
Changed in dkimpy (Ubuntu): | |
status: | New → Fix Released |
Changed in dkimpy (Ubuntu Xenial): | |
importance: | Undecided → High |
When passing a signed message in as bytes to the function in Python 3:
Traceback (most recent call last): signedmsg) ) python3/ dist-packages/ dkim/__ init__. py", line 630, in verify dnsfunc= dnsfunc) python3/ dist-packages/ dkim/__ init__. py", line 563, in verify python3/ dist-packages/ dkim/dnsplug. py", line 84, in get_txt
File "./dmarctests.py", line 45, in <module>
print("VERIFY: ", dkim.verify(
File "/usr/lib/
return d.verify(
File "/usr/lib/
s = dnsfunc(name)
File "/usr/lib/
txt = txt.encode('utf-8')
AttributeError: 'bytes' object has no attribute 'encode'