Avoid codec spelling issues by just using the utf-8 default.
authorRaymond Hettinger <python@rcn.com>
Thu, 5 May 2011 18:35:50 +0000 (11:35 -0700)
committerRaymond Hettinger <python@rcn.com>
Thu, 5 May 2011 18:35:50 +0000 (11:35 -0700)
Lib/random.py

index 6bdd439b3224ac00a8ccf359b4cdd56be6715f99..33d3634451ba1d26b08506cfc38994de4de9c30c 100644 (file)
@@ -114,7 +114,7 @@ class Random(_random.Random):
         if version == 2:
             if isinstance(a, (str, bytes, bytearray)):
                 if isinstance(a, str):
-                    a = a.encode("utf8")
+                    a = a.encode()
                 a += _sha512(a).digest()
                 a = int.from_bytes(a, 'big')