Bug 1457786
Summary: | rpmlint spams with "Python runtime initialized with LC_CTYPE=C" | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Miro Hrončok <mhroncok> |
Component: | rpmlint | Assignee: | Tom "spot" Callaway <tcallawa> |
Status: | CLOSED DUPLICATE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 26 | CC: | j, kevin, tcallawa, tmz, twoerner, ville.skytta |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-06-01 15:14:26 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Miro Hrončok
2017-06-01 10:07:41 UTC
What's your environment like? "env | grep -E 'LANG|LC_'" output? The specfile modifications you made make no difference as the errors come from somewhere else entirely. Actually they come from "rpm --specfile" command invoked by rpmlint, which is why there are no line numbers available; it doesn't give any in this case. Anyway, in a mock rawhide chroot I can reproduce but get only one such error, not 21, for the posted case. And I need to manually set LC_ALL=C, otherwise I get another related message (the one from bug 1436345). I have ideas what to do about this upstream, but would like a complete reproducer using docker that could be used in CI to verify behavior and test for regressions, see bug 1436345 comment 3 and 4. (In reply to Ville Skyttä from comment #1) > What's your environment like? "env | grep -E 'LANG|LC_'" output? LANG=cs_CZ.utf8 > The specfile modifications you made make no difference as the errors come > from somewhere else entirely. Actually they come from "rpm --specfile" > command invoked by rpmlint, which is why there are no line numbers > available; it doesn't give any in this case. > Anyway, in a mock rawhide chroot I can reproduce but get only one such > error, not 21, for the posted case. And I need to manually set LC_ALL=C, > otherwise I get another related message (the one from bug 1436345). > > I have ideas what to do about this upstream, but would like a complete > reproducer using docker that could be used in CI to verify behavior and test > for regressions, see bug 1436345 comment 3 and 4. Will look. BTW $ rpm --specfile ./ipython.spec ipython-6.1.0-1.fc26.noarch python3-ipython-6.1.0-1.fc26.noarch python3-ipython-sphinx-6.1.0-1.fc26.noarch python3-ipython-tests-6.1.0-1.fc26.noarch python3-ipython-doc-6.1.0-1.fc26.noarch $ LANG=C rpm --specfile ./ipython.spec Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). ipython-6.1.0-1.fc26.noarch python3-ipython-6.1.0-1.fc26.noarch python3-ipython-sphinx-6.1.0-1.fc26.noarch python3-ipython-tests-6.1.0-1.fc26.noarch python3-ipython-doc-6.1.0-1.fc26.noarch (I cannot reproduce this in mock without explicitly setting LANG=C and that also just prints this once.) /usr/share/rpmlint/SpecCheck.py:545 out = Pkg.getstatusoutput(('env', 'LC_ALL=C', 'rpm', '-q', '--qf=', '--specfile', self._spec_file)) Could this be changed to 'LC_ALL=C.UTF-8'? It fixes the problem for me. The difference between the messages: $ LC_ALL=C rpm -q --qf= --specfile /home/churchyard/rpmbuild/fedora-scm/ipython/ipython.spec Python runtime initialized with LC_CTYPE=C (a locale with default ASCII encoding), which may cause Unicode compatibility problems. Using C.UTF-8, C.utf8, or UTF-8 (if available) as alternative Unicode-compatible locales is recommended. ... [~]$ LANG=C rpm -q --qf= --specfile /home/churchyard/rpmbuild/fedora-scm/ipython/ipython.spec Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). ... I believe bug 1436345 and this one are duplicates. *** This bug has been marked as a duplicate of bug 1436345 *** (In reply to Miro Hrončok from comment #3) > BTW > > $ rpm --specfile ./ipython.spec > ipython-6.1.0-1.fc26.noarch > python3-ipython-6.1.0-1.fc26.noarch > python3-ipython-sphinx-6.1.0-1.fc26.noarch > python3-ipython-tests-6.1.0-1.fc26.noarch > python3-ipython-doc-6.1.0-1.fc26.noarch > > $ LANG=C rpm --specfile ./ipython.spec > Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another > locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). I suppose this means that rpm itself needs a "fix" as well. LANG=C is bad. I'd very much like to see a day when we build packages with LANG=C.UTF-8. In the meantime, we might want to "fix" all python3 macros to set LANG. Will discuss that on Python Devel ML. (In reply to Miro Hrončok from comment #4) > /usr/share/rpmlint/SpecCheck.py:545 > > out = Pkg.getstatusoutput(('env', 'LC_ALL=C', 'rpm', '-q', > '--qf=', '--specfile', self._spec_file)) > > Could this be changed to 'LC_ALL=C.UTF-8'? It fixes the problem for me. I think that could cause breakage in non-UTF-8 setups (e.g. if the command outputs non-ASCII UTF-8, and the read routines in Pkg.getstatusoutput expect e.g. ISO-8859-1). And besides, there are a lot more potential places for this breakage in rpmlint than just this one, basically everywhere where an executable is invoked. So it needs a more centralized fix (I'm on one). (In reply to Miro Hrončok from comment #8) > LANG=C is bad. I'd rather say that Python's default second guessing and deliberate incorrect^Htradition deviant handling of LANG=C, essentially treating it as an user error, is bad. But of course, if ones doesn't actually intend LANG=C, then one shouldn't use it but something else. > In the meantime, we might want to "fix" all python3 macros to > set LANG. Will discuss that on Python Devel ML. Setting PYTHONCOERCECLOCALE=0 could be a better choice, keeping e.g. ISO-8859-1 environments in mind. That's what I'm looking into doing first in rpmlint. |