[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sehk5uox.fsf@trenco.lwn.net>
Date: Thu, 21 Aug 2025 13:41:18 -0600
From: Jonathan Corbet <corbet@....net>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>, Linux Doc Mailing
List <linux-doc@...r.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>, Mauro Carvalho Chehab
<mchehab+huawei@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 10/11] scripts: sphinx-*: prevent sphinx-build crashes
Mauro Carvalho Chehab <mchehab+huawei@...nel.org> writes:
> + # The sphinx-build tool has a bug: internally, it tries to set
> + # locale with locale.setlocale(locale.LC_ALL, ''). This causes a
> + # crash if language is not set. Detect and fix it.
> + try:
> + locale.setlocale(locale.LC_ALL, '')
> + except Exception:
> + self.env["LC_ALL"] = "C"
> + self.env["LANG"] = "C"
In my years of writing Python, one of the most insidious things I have
encountered is this sort of wild-card catch; it can hide all kinds of
bugs. There must be a specific exception you can catch here?
Thanks,
jon
Powered by blists - more mailing lists