diff --git a/hgext/phabricator.py b/hgext/phabricator.py
index d5d1edf6609104b4d08b0838dfb80dd734b705bb_aGdleHQvcGhhYnJpY2F0b3IucHk=..162b81e65e60c04ba23eabf68659bb67f49e714d_aGdleHQvcGhhYnJpY2F0b3IucHk= 100644
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -518,7 +518,7 @@
     def addhunk(self, hunk):
         if not isinstance(hunk, phabhunk):
             raise error.Abort(b'phabchange.addhunk only takes phabhunks')
-        self.hunks.append(hunk)
+        self.hunks.append(pycompat.byteskwargs(attr.asdict(hunk)))
         # It's useful to include these stats since the Phab web UI shows them,
         # and uses them to estimate how large a change a Revision is. Also used
         # in email subjects for the [+++--] bit.
@@ -549,7 +549,9 @@
     def addchange(self, change):
         if not isinstance(change, phabchange):
             raise error.Abort(b'phabdiff.addchange only takes phabchanges')
-        self.changes[change.currentPath] = change
+        self.changes[change.currentPath] = pycompat.byteskwargs(
+            attr.asdict(change)
+        )
 
 
 def maketext(pchange, ctx, fname):