On Thu, Apr 26, 2018 at 12:38 AM,  <nbr...@sfu.ca> wrote:
> On Wednesday, April 25, 2018 at 2:31:55 PM UTC-7, Steven Trogdon wrote:
>> Is this a consequence of fixing the banner
>>
>>
>>
>> LC_ALL=C ./sage
>> SageMath version 8.2.rc4, Release Date: 2018-04-20
>>
>> and thus no banner, or has it always been this way? I only noticed because I 
>> had changed LC_ALL for some other purpose. I usually have LC_ALL unset with 
>> the other LC_ variables set individually.
>
> Yes, it is. With LC_ALL=C we get:
>
> sage: print(sage.misc.banner.banner_text())
> UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-69: 
> ordinal not in range(128)
>
> Previously, the banner was written into a file at build-time and displayed by 
> "cat"ing that file, so the contents of the file didn't pass through a Python 
> codec at runtime.
>
> I think python is basically correct in doing this: if the locale is C then 
> only ascii should be sent to the stdout, right?

Yes, that's more or less the correct behavior in the current Python
(although there are proposals to force Python to use LC_CTYPE=C.UTF-8
if LC_CTYPE=C).  But if the current locale uses a non-unicode encoding
then it assumes to only send ASCII.

The sage.misc.banner.banner() function catches that UnicodeEncodeError
and returns the plain banner.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-release+unsubscr...@googlegroups.com.
To post to this group, send email to sage-release@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-release.
For more options, visit https://groups.google.com/d/optout.

Reply via email to