Source

CherryPy / cherrypy / _cpcompat.py

Diff from to

File cherrypy/_cpcompat.py

     if not isinstance(n, nativestr):
         raise TypeError("n must be a native str (got %s)" % type(n).__name__)
 
+def always_bytes(str, encoding='utf-8'):
+    if isinstance(str, unicodestr):
+        str = str.encode(encoding)
+    return str
+
 try:
     set = set
 except NameError: