Bug 1459194 - It is not possible open Online Documentation, when env. var. LANG is unset
It is not possible open Online Documentation, when env. var. LANG is unset
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager (Show other bugs)
7.4
All Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Jiri Hnidek
John Sefler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-06 09:57 EDT by Jiri Hnidek
Modified: 2018-04-10 05:49 EDT (History)
3 users (show)

See Also:
Fixed In Version: subscription-manager-1.20.2-1
Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 05:49:05 EDT
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github candlepin/subscription-manager/pull/1653 None None None 2017-06-06 11:47 EDT
Red Hat Product Errata RHBA-2018:0681 None None None 2018-04-10 05:49 EDT

  None (edit)
Description Jiri Hnidek 2017-06-06 09:57:45 EDT
Description of problem:
When environment variable LANG is set or is set to some unsupported string, then it is not possible to open Online Documentaion in subscription-manager-gui.

Version-Release number of selected component (if applicable):
$ subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.33-1
subscription management rules: 5.23
subscription-manager: git #: ab8f6e98a3e56d6a166dcd40655d857309f85698
python-rhsm: git #: ab8f6e98a3e56d6a166dcd40655d857309f85698

How reproducible:
Always

Steps to Reproduce:
1. Unset environment variable LANG:
$ unset LANG

2. Start subscription manager GUI
$ subscription-manager-gui

3. Try to open Help->Online Documentation

Actual results:
Traceback (most recent call last):
  File "/home/jiri/github/candlepin/subscription_manager/src/subscription_manager/gui/managergui.py", line 547, in _online_docs_item_clicked
    webbrowser.open_new(self._get_online_doc_url())
  File "/home/jiri/github/candlepin/subscription_manager/src/subscription_manager/gui/managergui.py", line 572, in _get_online_doc_url
    url = ONLINE_DOC_URL_TEMPLATE % (lang.replace("_", "-"))
AttributeError: 'NoneType' object has no attribute 'replace'

Expected results:
Online documentation web page is opened in preferred web browser.

Additional info:
When environment variable LANG is set to some unsupported variable e.g.:

$ export LANG="alphabet.utf8"

, then online documentation web page is opened in preferred web browser with following note in terminal:

(process:27598): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Comment 3 Rehana 2017-11-13 04:13:44 EST
Reproducing the failure on RHEL74 
=================================

subscription-manager: 1.19.21-1.el7
python-rhsm: 1.19.9-1.el7

[root@dhcp35-85 ~]# unset LANG

Try to open Help->Online Documentation from subscription-manager-gui 

[root@dhcp35-85 ~]# subscription-manager-gui 
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/subscription_manager/gui/managergui.py", line 537, in _online_docs_item_clicked
    webbrowser.open_new(self._get_online_doc_url())
  File "/usr/lib/python2.7/site-packages/subscription_manager/gui/managergui.py", line 562, in _get_online_doc_url
    url = ONLINE_DOC_URL_TEMPLATE % (lang.replace("_", "-"))
AttributeError: 'NoneType' object has no attribute 'replace'

Verifying on RHEL75
===================
on, 
subscription-manager-rhsm-certificates-1.20.5-1.el7.x86_64
subscription-manager-gui-1.20.5-1.el7.x86_64
subscription-manager-rhsm-1.20.5-1.el7.x86_64
subscription-manager-1.20.5-1.el7.x86_64
subscription-manager-initial-setup-addon-1.20.5-1.el7.x86_64
subscription-manager-plugin-container-1.20.5-1.el7.x86_64

Observed that when LANG was unset , the online-documentation help was launched without any error message. Also verified that setting LANG to unsupported value continues to open the online documentation web page along with a note on the terminal 

[root@dhcp35-157 ~]# echo $LANG
en_US.UTF-8
[root@dhcp35-157 ~]# unset LANG
[root@dhcp35-157 ~]# echo $LANG

[root@dhcp35-157 ~]# subscription-manager-gui 

launch online-documentation , ^ no trace back message was observed.
[root@dhcp35-157 ~]# echo $LANG

[root@dhcp35-157 ~]# export LANG=alphabet.utf8
[root@dhcp35-157 ~]# echo $LANG
alphabet.utf8
[root@dhcp35-157 ~]# subscription-manager-gui 

(subscription-manager-gui:29772): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Fontconfig warning: ignoring alphabet.utf8: not a valid language tag

^^ observed this note on the terminal when launched online help documentation with a unsupported language.

Based on the above observations . marking the bug as verified!!
Comment 6 errata-xmlrpc 2018-04-10 05:49:05 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0681

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