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

Bug#435047: /usr/lib/hplip/base/g.py: assumes en_US.UTF-8 as default locale



root <1185653821@noid.net> writes:

> When using hp-sendfax, I found these messages in the CUPS error log:
>
>   D [] [Job 228] error: Unable to set locale.
>   D [] [Job 228] locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
>   D [] [Job 228] locale.Error: unsupported locale setting
>   E [] PID 9206 (/usr/lib/cups/backend/hpfax) stopped with status 1!
>
> Because of this error, hp-sendfax will not work...
>
> I solved the problem thusly:
>   -    locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
>   +    locale.setlocale(locale.LC_ALL, 'C')
>
> Is it proper to assume the system has 'en_US.UTF-8'...?

Absolutely not!  The only locale you can ever assume is present is
"C", and that's because it's strictly required by the ISO C and
POSIX/SUSv3 standards.

If you do depend on other locales, you should cope with their absence
gracefully.  Hard-coding a locale like this is wrong--it's not even
the user's preferred locale or the system locale.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: pgpt1QnrelQ_a.pgp
Description: PGP signature


Reply to: