diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst
index 49d2d9d..7bb5c5d 100644
--- a/docs/CHANGES.rst
+++ b/docs/CHANGES.rst
@@ -4,6 +4,9 @@ Changes
 5.1a0 (unreleased)
 ------------------
 
+- Add support for the ``bytes`` and ``sorted`` builtins
+  (`#186 <https://github.com/zopefoundation/RestrictedPython/issues/186>`_)
+
 - Drop install dependency on ``setuptools``.
   (`#189 <https://github.com/zopefoundation/RestrictedPython/issues/189>`_)
 
diff --git a/src/RestrictedPython/Guards.py b/src/RestrictedPython/Guards.py
index 0f2c8fc..e7ed96e 100644
--- a/src/RestrictedPython/Guards.py
+++ b/src/RestrictedPython/Guards.py
@@ -33,6 +33,7 @@ _safe_names = [
     'True',
     'abs',
     'bool',
+    'bytes',
     'callable',
     'chr',
     'complex',
@@ -52,6 +53,7 @@ _safe_names = [
     'repr',
     'round',
     'slice',
+    'sorted',
     'str',
     'tuple',
     'zip'
@@ -174,7 +176,6 @@ for name in _safe_exceptions:
 # one should care.
 
 # buffer
-# bytes
 # bytearray
 # classmethod
 # coerce

diff --git a/tests/test_Guards.py b/tests/test_Guards.py
index fe6b2e0..40bd6f0 100644
--- a/tests/test_Guards.py
+++ b/tests/test_Guards.py
@@ -15,6 +15,16 @@ def _write_(x):
     return x
 
 
+def test_Guards_bytes():
+    """It contains bytes"""
+    assert restricted_eval('bytes(1)') == bytes(1)
+
+
+def test_Guards_sorted():
+    """It contains sorted"""
+    assert restricted_eval('sorted([5, 2, 8, 1])') == sorted([5, 2, 8, 1])
+
+
 def test_Guards__safe_builtins__1():
     """It contains `slice()`."""
     assert restricted_eval('slice(1)') == slice(1)

Adding "bytes" to allowed builtin names
Having `bytes` would allow a sane way of getting at `OFS.Image.File` data in restricted code under Python 3. `str` is inappropriate because it wants to decode the file content using the default UTF-8 encoding that may not match the actual encoding used by file contents.

Calling this a Zope 4 bugfix because having only `str` for those cases is a recipe for problems.

tests/test_Guards.py::test_Guards_bytes tests/test_Guards.py::test_Guards_sorted
tests/test_Guards.py::test_Guards__safe_builtins__1 tests/test_Guards.py::test_Guards__safe_builtins__2 tests/test_Guards.py::test_Guards__guarded_setattr__1 tests/test_Guards.py::test_Guards__write_wrapper__1 tests/test_Guards.py::test_Guards__write_wrapper__2 tests/test_Guards.py::test_Guards__guarded_unpack_sequence__1 tests/test_Guards.py::test_Guards__safer_getattr__1 tests/test_Guards.py::test_Guards__safer_getattr__2 tests/test_Guards.py::test_Guards__safer_getattr__3 tests/test_Guards.py::test_call_py3_builtins tests/test_Guards.py::test_safer_getattr__underscore_name