Merge pull request #779 from mwhudson/utf8-fallback
call setlocale() and set LC_CTYPE to C.UTF-8 if it fails
This commit is contained in:
commit
8628cbb0b8
|
@ -3,7 +3,7 @@ early-commands:
|
||||||
- echo a
|
- echo a
|
||||||
- sleep 1
|
- sleep 1
|
||||||
- echo a
|
- echo a
|
||||||
locale: en_UK.UTF-8
|
locale: en_GB.UTF-8
|
||||||
refresh-installer:
|
refresh-installer:
|
||||||
update: yes
|
update: yes
|
||||||
channel: edge
|
channel: edge
|
||||||
|
|
|
@ -42,7 +42,7 @@ validate
|
||||||
python3 scripts/check-yaml-fields.py .subiquity/subiquity-curtin-install.conf \
|
python3 scripts/check-yaml-fields.py .subiquity/subiquity-curtin-install.conf \
|
||||||
debconf_selections.subiquity='"eek"'
|
debconf_selections.subiquity='"eek"'
|
||||||
python3 scripts/check-yaml-fields.py .subiquity/var/lib/cloud/seed/nocloud-net/user-data \
|
python3 scripts/check-yaml-fields.py .subiquity/var/lib/cloud/seed/nocloud-net/user-data \
|
||||||
locale='"en_UK.UTF-8"'
|
locale='"en_GB.UTF-8"'
|
||||||
grep -q 'finish: subiquity/InstallProgress/install/postinstall/install_package1: SUCCESS: installing package1' \
|
grep -q 'finish: subiquity/InstallProgress/install/postinstall/install_package1: SUCCESS: installing package1' \
|
||||||
.subiquity/subiquity-debug.log
|
.subiquity/subiquity-debug.log
|
||||||
grep -q 'finish: subiquity/InstallProgress/install/postinstall/install_package2: SUCCESS: installing package2' \
|
grep -q 'finish: subiquity/InstallProgress/install/postinstall/install_package2: SUCCESS: installing package2' \
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import locale
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import fcntl
|
import fcntl
|
||||||
|
@ -103,6 +104,13 @@ AUTO_ANSWERS_FILE = "/subiquity_config/answers.yaml"
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
# Python 3.7+ does more or less this by default, but we need to
|
||||||
|
# work with the Python 3.6 in bionic.
|
||||||
|
try:
|
||||||
|
locale.setlocale(locale.LC_ALL, "")
|
||||||
|
except locale.Error:
|
||||||
|
locale.setlocale(locale.LC_CTYPE, "C.UTF-8")
|
||||||
|
|
||||||
# Prefer utils from $SNAP, over system-wide
|
# Prefer utils from $SNAP, over system-wide
|
||||||
snap = os.environ.get('SNAP')
|
snap = os.environ.get('SNAP')
|
||||||
if snap:
|
if snap:
|
||||||
|
|
Loading…
Reference in New Issue