diff --git a/mercurial/error.py b/mercurial/error.py
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -137,6 +137,10 @@
 
     def __init__(self, status_code):
         self.status_code = status_code
+        # Pass status code to superclass just so it becomes part of __bytes__
+        super(WorkerError, self).__init__(status_code)
+
+    __bytes__ = _tobytes
 
 
 class InterventionRequired(Hint, Exception):
diff --git a/tests/test-worker.t b/tests/test-worker.t
--- a/tests/test-worker.t
+++ b/tests/test-worker.t
@@ -90,7 +90,8 @@
   mercurial.error.Abort: known exception (py3 !)
   Abort: known exception (no-py3 !)
       raise error.WorkerError(status)
-  mercurial.error.WorkerError: 255
+  WorkerError: 255 (no-py3 !)
+  mercurial.error.WorkerError: 255 (py3 !)
 
 Traceback must be printed for unknown exceptions