[PATCH] docs: conf.py: fix the 'utf-8' typo

Randy Dunlap posted 1 patch 1 month, 3 weeks ago
Documentation/conf.py |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] docs: conf.py: fix the 'utf-8' typo
Posted by Randy Dunlap 1 month, 3 weeks ago
"encoding" should be 'utf-8'. Fix the typo.

Fixes: 7ea9a550f710 ("docs: conf.py: several coding style fixes")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>

 Documentation/conf.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20260805.orig/Documentation/conf.py
+++ linux-next-20260805/Documentation/conf.py
@@ -287,7 +287,7 @@ author = "The kernel development communi
 try:
     makefile_version = None
     makefile_patchlevel = None
-    with open("../Makefile", encoding="utf=8") as fp:
+    with open("../Makefile", encoding="utf-8") as fp:
         for line in fp:
             key, val = [x.strip() for x in line.split("=", 2)]
             if key == "VERSION":
Re: [PATCH] docs: conf.py: fix the 'utf-8' typo
Posted by Jonathan Corbet 1 month, 3 weeks ago
Randy Dunlap <rdunlap@infradead.org> writes:

> "encoding" should be 'utf-8'. Fix the typo.
>
> Fixes: 7ea9a550f710 ("docs: conf.py: several coding style fixes")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> ---
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Shuah Khan <skhan@linuxfoundation.org>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
>
>  Documentation/conf.py |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-next-20260805.orig/Documentation/conf.py
> +++ linux-next-20260805/Documentation/conf.py
> @@ -287,7 +287,7 @@ author = "The kernel development communi
>  try:
>      makefile_version = None
>      makefile_patchlevel = None
> -    with open("../Makefile", encoding="utf=8") as fp:
> +    with open("../Makefile", encoding="utf-8") as fp:
>          for line in fp:

So this is somewhat weird... open() will throw an exception with an
unknown encoding, but takes "utf=8" without complaint.  Somehow they are
explicitly handling that case.  So the code is arguably correct :)

That said, I've applied the patch, thanks.

jon
Re: [PATCH] docs: conf.py: fix the 'utf-8' typo
Posted by Randy Dunlap 1 month, 2 weeks ago

On 8/11/26 9:46 AM, Jonathan Corbet wrote:
> Randy Dunlap <rdunlap@infradead.org> writes:
> 
>> "encoding" should be 'utf-8'. Fix the typo.
>>
>> Fixes: 7ea9a550f710 ("docs: conf.py: several coding style fixes")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> ---
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Cc: Shuah Khan <skhan@linuxfoundation.org>
>> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
>>
>>  Documentation/conf.py |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- linux-next-20260805.orig/Documentation/conf.py
>> +++ linux-next-20260805/Documentation/conf.py
>> @@ -287,7 +287,7 @@ author = "The kernel development communi
>>  try:
>>      makefile_version = None
>>      makefile_patchlevel = None
>> -    with open("../Makefile", encoding="utf=8") as fp:
>> +    with open("../Makefile", encoding="utf-8") as fp:
>>          for line in fp:
> 
> So this is somewhat weird... open() will throw an exception with an
> unknown encoding, but takes "utf=8" without complaint.  Somehow they are
> explicitly handling that case.  So the code is arguably correct :)

It's not listed as a valid alias anywhere that I can find.

But then using "utf8" is only a valid alias when using cpython codecs AFAICT:

kdoc_parser.py:1690:            with open(self.fname, "r", encoding="utf8",
kdoc_parser.py:1731:            with open(self.fname, "r", encoding="utf8",

> That said, I've applied the patch, thanks.


-- 
~Randy