Activity log for bug #1541343

Date Who What changed Old value New value Message
2016-02-03 11:35:48 toxinu bug added bug
2016-02-03 11:35:48 toxinu attachment added fix-should-headers-as-bytes.patch https://bugs.launchpad.net/bugs/1541343/+attachment/4562907/+files/fix-should-headers-as-bytes.patch
2016-02-03 11:36:19 toxinu description This bug only occur with Python 3 (tested with 3.4). `references` header field in DKIM.SHOULD is not represented as bytes. Test that show bug: ``` def test_simple_signature(self): # A message verifies after being signed with SHOULD headers for header_algo in (b"simple", b"relaxed"): for body_algo in (b"simple", b"relaxed"): sig = dkim.sign( self.message, b"test", b"example.com", self.key, canonicalize=(header_algo, body_algo), include_headers=(b'from',) + dkim.DKIM.SHOULD) res = dkim.verify(sig + self.message, dnsfunc=self.dnsfunc) self.assertTrue(res) ``` ====================================================================== ERROR: test_simple_signature (dkim.tests.test_dkim.TestSignAndVerify) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/glehee/Documents/Repositories/dkimpy/dkim/tests/test_dkim.py", line 87, in test_simple_signature include_headers=(b'from',) + dkim.DKIM.SHOULD) File "/home/glehee/Documents/Repositories/dkimpy/dkim/__init__.py", line 620, in sign return d.sign(selector, domain, privkey, identity=identity, canonicalize=canonicalize, include_headers=include_headers, length=length) File "/home/glehee/Documents/Repositories/dkimpy/dkim/__init__.py", line 471, in sign (b'h', b" : ".join(include_headers)), TypeError: sequence item 20: expected a bytes-like object, str found You can found this work on our github branch here: https://github.com/oasiswork/dkimpy/commit/6a4dd61b86f8358d4632c17ea6636651387874c7 This bug only occur with Python 3 (tested with 3.4). `references` header field in DKIM.SHOULD is not represented as bytes. Test that show bug: ``` def test_simple_signature(self):     # A message verifies after being signed with SHOULD headers     for header_algo in (b"simple", b"relaxed"):         for body_algo in (b"simple", b"relaxed"):             sig = dkim.sign(   self.message, b"test", b"example.com", self.key,       canonicalize=(header_algo, body_algo),       include_headers=(b'from',) + dkim.DKIM.SHOULD)      res = dkim.verify(sig + self.message, dnsfunc=self.dnsfunc)      self.assertTrue(res) ``` ====================================================================== ERROR: test_simple_signature (dkim.tests.test_dkim.TestSignAndVerify) ---------------------------------------------------------------------- Traceback (most recent call last):   File "/home/glehee/Documents/Repositories/dkimpy/dkim/tests/test_dkim.py", line 87, in test_simple_signature     include_headers=(b'from',) + dkim.DKIM.SHOULD)   File "/home/glehee/Documents/Repositories/dkimpy/dkim/__init__.py", line 620, in sign     return d.sign(selector, domain, privkey, identity=identity, canonicalize=canonicalize, include_headers=include_headers, length=length)   File "/home/glehee/Documents/Repositories/dkimpy/dkim/__init__.py", line 471, in sign     (b'h', b" : ".join(include_headers)), TypeError: sequence item 20: expected a bytes-like object, str found You can found this work on our github branch here: https://github.com/oasiswork/dkimpy/commit/6a4dd61b86f8358d4632c17ea6636651387874c7
2017-03-03 00:09:15 Scott Kitterman dkimpy: importance Undecided Medium
2017-03-03 00:09:15 Scott Kitterman dkimpy: status New Fix Committed
2017-05-31 13:15:27 Scott Kitterman dkimpy: status Fix Committed Fix Released