Re: [PATCH 10/11] scripts: sphinx-*: prevent sphinx-build crashes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx> 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




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux