If you feed it bytes, it works fine:

>>> print(message)
b'Authentication-Results: lists.example.org; arc=none; spf=pass 
[email protected]; dkim=pass (1024-bit key) [email protected]; 
dmarc=pass\nReceived: from localhost\nMessage-ID: <[email protected]>\nDate: 
Mon, 01 Jan 2011 01:02:03 +0400\nFrom: Test User <[email protected]>\nTo: 
[email protected]\nSubject: Testing\n\nThis is a test message.\n'
>>> sig = dkim.dkim_sign(message, b"test", b"example.com", key)

** Changed in: dkimpy
       Status: New => Invalid

** Changed in: dkimpy (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1782416

Title:
  Python3 Compat Problem: "Cannot use a bytes pattern on a string-like
  object"

To manage notifications about this bug go to:
https://bugs.launchpad.net/dkimpy/+bug/1782416/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to