Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: Doctest failures in some locales #30586

Open
mkoeppe opened this issue Sep 16, 2020 · 4 comments
Open

macOS: Doctest failures in some locales #30586

mkoeppe opened this issue Sep 16, 2020 · 4 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Sep 16, 2020

There are also some other locale problems that show up in doctests
(for example https://groups.google.com/d/msg/sage-release/spalYgXKr-4/ZVsbgHIlAgAJ and https://groups.google.com/g/sage-release/c/IiGznoPMATI/m/jynWfRcmDAAJ)

sage -t --long --warn-long 113.2 --random-seed=0 src/sage/misc/sageinspect.py
**********************************************************************
File "src/sage/misc/sageinspect.py", line 1497, in sage.misc.sageinspect.sage_getargspec
Failed example:
    sage.misc.sageinspect.sage_getargspec(r.lm)
Expected:
    ArgSpec(args=['self'], varargs='args', keywords='kwds', defaults=None)
Got:
     起動準備中です -  警告メッセージ: 
    1: Setting LC_COLLATE failed, using "C" 
    2: Setting LC_TIME failed, using "C" 
    3: Setting LC_MESSAGES failed, using "C" 
    4: Setting LC_MONETARY failed, using "C" 
    ArgSpec(args=['self'], varargs='args', keywords='kwds', defaults=None)

Perhaps just a misconfigured system, but we should make sure to robustly set a consistent locale in which the doctests are run.

CC: @dimpase @orlitzky @seblabbe

Component: doctest framework

Issue created by migration from https://trac.sagemath.org/ticket/30586

@mkoeppe mkoeppe added this to the sage-9.2 milestone Sep 16, 2020
@mkoeppe
Copy link
Member Author

mkoeppe commented Sep 23, 2020

comment:1

This doctest is:

        sage: sage.misc.sageinspect.sage_getargspec(r.lm)

It causes the R interface to start up, and then R may complain about bad locales on a misconfigured system.

We could of course force a locale in sage -t, but I don't think this is a pressing issue.

@orlitzky
Copy link
Contributor

comment:2

If anything, I think it would be rpy2 that should set LC_ALL=C before it launches its embedded copy of the R interpreter. But I really have no idea how rpy2 works (that is, if it handles locale issues transparently), so that suggestion would be premature. In any case, the cause of this error is that the R interpreter was launched with an invalid environment. For example,

$ LC_ALL=derp R --no-save -q
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_COLLATE failed, using "C" 
3: Setting LC_TIME failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
5: Setting LC_PAPER failed, using "C" 
6: Setting LC_MEASUREMENT failed, using "C" 
>

I'm thinking this is not something we need to fix.

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@slel
Copy link
Member

slel commented Mar 27, 2021

comment:4

Should this instead be reported to rpy2?

https://github.com/rpy2/rpy2/issues

@mkoeppe
Copy link
Member Author

mkoeppe commented Apr 7, 2021

comment:5

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants