summaryrefslogtreecommitdiff
path: root/Lib/random.py
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2011-02-25 15:42:01 +0000
committerMarc-André Lemburg <mal@egenix.com>2011-02-25 15:42:01 +0000
commit096c745e602a5c3f2fcf697ab6323422ef4a2f68 (patch)
tree8015a04bfa9d0b7774e7fbf5377bb7082cd92e3c /Lib/random.py
parentdb738bcdbbd679cacf8be85f9f0f08760ce9e1e5 (diff)
downloadcpython-096c745e602a5c3f2fcf697ab6323422ef4a2f68.tar.gz
Normalize the encoding names for Latin-1 and UTF-8 to
'latin-1' and 'utf-8'. These are optimized in the Python Unicode implementation to result in more direct processing, bypassing the codec registry. Also see issue11303.
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py
index cb49d5634f..f29803e8fb 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -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("utf-8")
a += _sha512(a).digest()
a = int.from_bytes(a, 'big')