Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/bin/sage-system-python: Work around LC_ALL=C
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Sep 21, 2020
1 parent 5ec24db commit 9403629
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build/bin/sage-system-python
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ fi
# is accessible by this python; this is to guard on Cygwin against Pythons
# installed somewhere else in Windows.

# Trac #30008: Make it work even if the environment tries to sabotage UTF-8
# operation in Python 3.0.x-3.6.x by setting LC_ALL=C or similar.

if [ "$LC_ALL" = "C" -o "$LANG" = "C" -o "$LC_CTYPE" = "C" ]; then
LC_ALL=$(locale -a | grep -E -i '^(c|en_us)[-.]utf-?8$' | head -n 1)
LANG=$LC_ALL
export LC_ALL
export LANG
fi

PYTHONS="python python3 python3.8 python3.7 python2.7 python3.6 python2"
for PY in $PYTHONS; do
PYTHON="$(PATH="$SAGE_ORIG_PATH" command -v $PY)"
Expand Down

0 comments on commit 9403629

Please sign in to comment.