Opened 8 months ago

Last modified 5 weeks ago

#30586 new defect

macOS: Doctest failures in some locales

Reported by: mkoeppe Owned by:
Priority: minor Milestone: sage-9.4
Component: doctest framework Keywords:
Cc: dimpase, mjo, slabbe Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

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.

Change History (5)

comment:1 Changed 8 months ago by mkoeppe

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.

comment:2 Changed 8 months ago by mjo

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.

comment:3 Changed 7 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3

comment:4 Changed 6 weeks ago by slelievre

Should this instead be reported to rpy2?

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

comment:5 Changed 5 weeks ago by mkoeppe

  • Milestone changed from sage-9.3 to sage-9.4

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

Note: See TracTickets for help on using tickets.