File tree Expand file tree Collapse file tree 5 files changed +8
-36
lines changed
Filter options
Expand file tree Collapse file tree 5 files changed +8
-36
lines changed
Original file line number Diff line number Diff line change @@ -235,12 +235,6 @@ The legacy interface:
235
235
236
236
.. versionadded :: 3.1
237
237
238
- .. function :: decodestring(s)
239
-
240
- Deprecated alias of :func: `decodebytes `.
241
-
242
- .. deprecated :: 3.1
243
-
244
238
245
239
.. function :: encode(input, output)
246
240
@@ -261,12 +255,6 @@ The legacy interface:
261
255
262
256
.. versionadded :: 3.1
263
257
264
- .. function :: encodestring(s)
265
-
266
- Deprecated alias of :func: `encodebytes `.
267
-
268
- .. deprecated :: 3.1
269
-
270
258
271
259
An example usage of the module:
272
260
Original file line number Diff line number Diff line change @@ -411,6 +411,11 @@ Removed
411
411
of :pep: `442 `. Patch by Joannah Nanjekye.
412
412
(Contributed by Joannah Nanjekye in :issue: `15088 `)
413
413
414
+ * ``base64.encodestring() `` and ``base64.decodestring() ``, aliases deprecated
415
+ since Python 3.1, have been removed: use :func: `base64.encodebytes ` and
416
+ :func: `base64.decodebytes ` instead.
417
+ (Contributed by Victor Stinner in :issue: `39351 `.)
418
+
414
419
415
420
Porting to Python 3.9
416
421
=====================
Original file line number Diff line number Diff line change @@ -531,28 +531,12 @@ def encodebytes(s):
531
531
pieces .append (binascii .b2a_base64 (chunk ))
532
532
return b"" .join (pieces )
533
533
534
- def encodestring (s ):
535
- """Legacy alias of encodebytes()."""
536
- import warnings
537
- warnings .warn ("encodestring() is a deprecated alias since 3.1, "
538
- "use encodebytes()" ,
539
- DeprecationWarning , 2 )
540
- return encodebytes (s )
541
-
542
534
543
535
def decodebytes (s ):
544
536
"""Decode a bytestring of base-64 data into a bytes object."""
545
537
_input_type_check (s )
546
538
return binascii .a2b_base64 (s )
547
539
548
- def decodestring (s ):
549
- """Legacy alias of decodebytes()."""
550
- import warnings
551
- warnings .warn ("decodestring() is a deprecated alias since Python 3.1, "
552
- "use decodebytes()" ,
553
- DeprecationWarning , 2 )
554
- return decodebytes (s )
555
-
556
540
557
541
# Usable as a script...
558
542
def main ():
Original file line number Diff line number Diff line change @@ -18,14 +18,6 @@ def check_type_errors(self, f):
18
18
int_data = memoryview (b"1234" ).cast ('I' )
19
19
self .assertRaises (TypeError , f , int_data )
20
20
21
- def test_encodestring_warns (self ):
22
- with self .assertWarns (DeprecationWarning ):
23
- base64 .encodestring (b"www.python.org" )
24
-
25
- def test_decodestring_warns (self ):
26
- with self .assertWarns (DeprecationWarning ):
27
- base64 .decodestring (b"d3d3LnB5dGhvbi5vcmc=\n " )
28
-
29
21
def test_encodebytes (self ):
30
22
eq = self .assertEqual
31
23
eq (base64 .encodebytes (b"www.python.org" ), b"d3d3LnB5dGhvbi5vcmc=\n " )
Original file line number Diff line number Diff line change
1
+ Remove ``base64.encodestring() `` and ``base64.decodestring() ``, aliases
2
+ deprecated since Python 3.1: use :func: `base64.encodebytes ` and
3
+ :func: `base64.decodebytes ` instead.
You can’t perform that action at this time.
0 commit comments