Bug 1432426 - The base-cloud Vagrant images set ASCII locale when client does not use en_US.utf8/C.utf8
Summary: The base-cloud Vagrant images set ASCII locale when client does not use en_US...
Status: ON_QA
Alias: None
Product: Fedora
Classification: Fedora
Component: distribution   
(Show other bugs)
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Václav Pavlín
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords: Reopened
Depends On:
Blocks: 1421610
TreeView+ depends on / blocked
 
Reported: 2017-03-15 11:25 UTC by Miro Hrončok
Modified: 2019-04-03 11:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-12-12 10:45:26 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Miro Hrončok 2017-03-15 11:25:18 UTC
Description of problem:
When using the Vagrant base-cloud image, all non-en (all but C, en_US, C.utf8 and en_US.utf8) locales are gone. If you ssh in and your locale is non-en, the system will fall back to C. That is an ASCII locale an that causes trouble.

Version-Release number of selected component (if applicable):
Fedora 25, 26 and probably all others.

How reproducible:
Easy

Steps to Reproduce:
1. vagrant init fedora/25-cloud-base
2. vagrant up
3. LANG=cs_CZ.utf8 vagrant ssh
4. $ dnf
5. $ echo ččč > file
6. $ python3
Python 3.5.2 (default, Sep 14 2016, 11:28:32) 
[GCC 6.2.1 20160901 (Red Hat 6.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> with open('file') as f:
...     print(f.read())
... 



Actual results:
Failed to set locale, defaulting to C
...

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/lib64/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128)

Expected results:
Deal with my locale or set C.utf8
...
ččč

Additional info:
We are workarounding this problem in python3. But I still except that a modern system would work with utf8 buy default if it cannot find my locale.


In this scenario, I suppose the Vagrant image should set the locale back to en_US.utf8 or C.utf8 when it cannot find the locale of the SSH client.

Comment 1 Dennis Gilmore 2017-03-15 18:29:16 UTC
This is by design in the cloud base image https://pagure.io/fedora-kickstarts/blob/master/f/fedora-cloud-base.ks#_153 https://pagure.io/fedora-kickstarts/blob/master/f/fedora-cloud-base.ks#_53 I suspect that the owners will not want to change the behaviour

Comment 2 Fedora End Of Life 2017-11-16 19:10:38 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2017-12-12 10:45:26 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 4 Miro Hrončok 2017-12-12 12:41:13 UTC
While python now has mechanism in place to deal with ASCII locales, I still see this as a problem.

Comment 5 Fedora End Of Life 2018-02-20 15:31:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 6 Miro Hrončok 2019-01-07 22:54:08 UTC
There is a proposed Fedora change that fixes this: https://fedoraproject.org/wiki/Changes/Reset-locale-if-not-available

Comment 7 Ben Cotton 2019-02-19 17:12:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle.
Changing version to '30.


Note You need to log in before you can comment on or make changes to this bug.