Skip to content

Commit b5f3df3

Browse files
Little fixes
1 parent 4bae23a commit b5f3df3

4 files changed

Lines changed: 40 additions & 12 deletions

File tree

Lib/encodings/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
class CodecRegistryError(LookupError, SystemError):
5454
pass
5555

56-
def normalize_encoding(encoding, /):
56+
def normalize_encoding(encoding):
5757

5858
""" Normalize an encoding name.
5959

Modules/_codecsmodule.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,17 +1027,15 @@ extern int _Py_normalize_encoding(const char *, char *, size_t, int);
10271027
/*[clinic input]
10281028
_codecs._normalize_encoding
10291029
encoding: str(encoding='ascii')
1030-
/
10311030
10321031
Normalize an encoding name *encoding*.
10331032
1034-
Used for encodings.normalize_encoding.
1035-
Does not convert to lower case (to_lower == 1).
1033+
Used for encodings.normalize_encoding. Does not convert to lower case.
10361034
[clinic start generated code]*/
10371035

10381036
static PyObject *
10391037
_codecs__normalize_encoding_impl(PyObject *module, char *encoding)
1040-
/*[clinic end generated code: output=d5e3a4b5266fbe96 input=ca002bbc262228f1]*/
1038+
/*[clinic end generated code: output=d5e3a4b5266fbe96 input=cdb53c013b2400e3]*/
10411039
{
10421040
size_t len = strlen(encoding);
10431041
if (len > PY_SSIZE_T_MAX) {

Modules/clinic/_codecsmodule.c.h

Lines changed: 36 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3588,7 +3588,7 @@ PyUnicode_FromEncodedObject(PyObject *obj,
35883588
}
35893589

35903590
/* Normalize an encoding name like encodings.normalize_encoding()
3591-
Optionally covert convert to lowercase by setting *to_lower* to 1.
3591+
but allow to convert to lowercase if *to_lower* is true.
35923592
Return 1 on success, or 0 on error (encoding is longer than lower_len-1). */
35933593
int
35943594
_Py_normalize_encoding(const char *encoding,

0 commit comments

Comments
 (0)