diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2021-04-30 14:10:28 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2021-04-30 14:31:02 +0200 |
commit | a0861f2e90572d6c45eb05adb69e7069d9f99a58 (patch) | |
tree | 1fd666de941cbf0bfb2321eef12684ffd4a7dead | |
parent | 653c943fa1e2379e1f0acbc4c035d9ac322f9d72 (diff) |
security_db: replace base64.encodestring with encodebytes
It was an alias for the latter, and has finally been removed in
Python 3.9.
Likewise for decodestring.
-rw-r--r-- | lib/python/security_db.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/python/security_db.py b/lib/python/security_db.py index 396df949c6..674adeb342 100644 --- a/lib/python/security_db.py +++ b/lib/python/security_db.py @@ -1569,7 +1569,7 @@ class DB: kind, urgency_to_flag[urgency], remote, fix_available, package, fixed_version, description)) - result = base64.encodestring(zlib.compress(''.join(result).encode('utf-8'), 9)) + result = base64.encodebytes(zlib.compress(''.join(result).encode('utf-8'), 9)) c.execute( "INSERT OR REPLACE INTO debsecan_data (name, data) VALUES (?, ?)", @@ -1740,7 +1740,7 @@ class DB: source_packages.sort() def store_value(name, value): - value = base64.encodestring(zlib.compress(value.encode('utf-8'), 9)) + value = base64.encodebytes(zlib.compress(value.encode('utf-8'), 9)) c.execute("""INSERT OR REPLACE INTO debsecan_data VALUES (?, ?)""", (name, value)) @@ -1791,7 +1791,7 @@ class DB: """Returns the debsecan data item NAME.""" for (data,) in self.cursor().execute( "SELECT data FROM debsecan_data WHERE name = ?", (name,)): - return base64.decodestring(data) + return base64.decodebytes(data) else: return None |