[PATCH] Body length not cast as bytes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dkimpy |
Fix Released
|
Medium
|
Unassigned |
Bug Description
This bug only occur with Python 3 (tested with 3.4).
When building signed headers with `length=True`, `sign` crash.
Test that show bug:
```
def test_add_
sig = dkim.sign(
msg = email.message_
res = dkim.verify(sig + self.message, dnsfunc=
```
=======
ERROR: test_add_
-------
Traceback (most recent call last):
File "/home/
self.message, b"test", b"example.com", self.key, length=True)
File "/home/
return d.sign(selector, domain, privkey, identity=identity, canonicalize=
File "/home/
sig_value = fold(b"; ".join(b"=".join(x) for x in sigfields))
File "/home/
sig_value = fold(b"; ".join(b"=".join(x) for x in sigfields))
TypeError: sequence item 1: expected a bytes-like object, int found
You can found this work on our github branch here:
https:/
Fixed in revision 134. Will be included in 0.6.2.