@@ -1625,13 +1625,15 @@ expression support in the :mod:`re` module).
1625
1625
.. method :: str.encode(encoding="utf-8", errors="strict")
1626
1626
1627
1627
Return an encoded version of the string as a bytes object. Default encoding
1628
- is ``'utf-8' ``. *errors * may be given to set a different error handling scheme.
1629
- The default for *errors * is ``'strict' ``, meaning that encoding errors raise
1630
- a :exc: `UnicodeError `. Other possible
1631
- values are ``'ignore' ``, ``'replace' ``, ``'xmlcharrefreplace' ``,
1632
- ``'backslashreplace' `` and any other name registered via
1633
- :func: `codecs.register_error `, see section :ref: `error-handlers `. For a
1634
- list of possible encodings, see section :ref: `standard-encodings `.
1628
+ is ``'utf-8' ``. And for a list of possible encodings, see section
1629
+ :ref: `standard-encodings `.
1630
+
1631
+ *errors * may be given to set a different error handling scheme. The
1632
+ default for *errors * is ``'strict' ``, meaning that encoding errors raise
1633
+ a :exc: `UnicodeError `. Other possible values are ``'ignore' ``,
1634
+ ``'replace' ``, ``'xmlcharrefreplace' ``, ``'backslashreplace' `` and any
1635
+ other name registered via :func: `codecs.register_error `, see section
1636
+ :ref: `error-handlers `.
1635
1637
1636
1638
By default, the *errors * argument is not checked for best performances, but
1637
1639
only used at the first encoding error. Enable the :ref: `Python Development
@@ -2760,12 +2762,14 @@ arbitrary binary data.
2760
2762
bytearray.decode(encoding="utf-8", errors="strict")
2761
2763
2762
2764
Return a string decoded from the given bytes. Default encoding is
2763
- ``'utf-8' ``. *errors * may be given to set a different
2764
- error handling scheme. The default for *errors * is ``'strict' ``, meaning
2765
- that encoding errors raise a :exc: `UnicodeError `. Other possible values are
2766
- ``'ignore' ``, ``'replace' `` and any other name registered via
2767
- :func: `codecs.register_error `, see section :ref: `error-handlers `. For a
2768
- list of possible encodings, see section :ref: `standard-encodings `.
2765
+ ``'utf-8' ``. And for a list of possible encodings, see section
2766
+ :ref: `standard-encodings `.
2767
+
2768
+ *errors * may be given to set a different error handling scheme. The
2769
+ default for *errors * is ``'strict' ``, meaning that encoding errors raise a
2770
+ :exc: `UnicodeError `. Other possible values are ``'ignore' ``, ``'replace' ``
2771
+ and any other name registered via :func: `codecs.register_error `, see
2772
+ section :ref: `error-handlers `.
2769
2773
2770
2774
By default, the *errors * argument is not checked for best performances, but
2771
2775
only used at the first decoding error. Enable the :ref: `Python Development
0 commit comments