gnome-language-selector crashed with TypeError in getCurrentInputMethod(): 'NoneType' object is not subscriptable

Bug #1723318 reported by sourcepower on 2017-10-13
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
language-selector (Ubuntu)
Medium
Gunnar Hjalmarsson

Bug Description

- fresh Lubuntu 17.10 install with daily iso from 10/12/2017 incl. latest updates
- opening of Start => Preferences => Language Support results in the error

ProblemType: Crash
DistroRelease: Ubuntu 17.10
Package: language-selector-gnome 0.180
ProcVersionSignature: Ubuntu 4.13.0-15.16-generic 4.13.4
Uname: Linux 4.13.0-15-generic x86_64
ApportVersion: 2.20.7-0ubuntu3
Architecture: amd64
CurrentDesktop: LXDE
Date: Fri Oct 13 06:11:35 2017
ExecutablePath: /usr/bin/gnome-language-selector
InstallationDate: Installed on 2017-10-13 (0 days ago)
InstallationMedia: Lubuntu 17.10 "Artful Aardvark" - Beta amd64 (20171011)
InterpreterPath: /usr/bin/python3.6
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/gnome-language-selector
ProcEnviron:
 LANGUAGE=en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C
 SHELL=/bin/bash
Python3Details: /usr/bin/python3.6, Python 3.6.3, python3-minimal, 3.6.3-0ubuntu2
PythonArgs: ['/usr/bin/gnome-language-selector']
PythonDetails: /home/steven/Error: command ['which', 'python'] failed with exit code 1:, Error: [Errno 2] No such file or directory: "/home/steven/Error: command ['which', 'python'] failed with exit code 1:": "/home/steven/Error: command ['which', 'python'] failed with exit code 1:", unpackaged
SourcePackage: language-selector
Title: gnome-language-selector crashed with TypeError in getCurrentInputMethod(): 'NoneType' object is not subscriptable
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

sourcepower (sourcepower) wrote :
tags: removed: need-duplicate-check
Changed in language-selector (Ubuntu):
importance: Undecided → Medium
information type: Private → Public
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your report. I see that the LANG environment variable is set to C, which is not normal in a desktop session (it should be some .UTF-8 locale), and I think it explains the crash. Unless you set LANG=C yourself, that value may be related to <https://launchpad.net/bugs/1723404>.

Can you please show us the output from these terminal commands:

cat /etc/default/locale

locale -a

locale

Changed in language-selector (Ubuntu):
status: New → Incomplete
sourcepower (sourcepower) wrote :

I didn't change the LANG environment variables during or after the installation. I used the Lubuntu 17.10 Alternate ISO (version from 10/12/2017) to install the Lubuntu system. I also remember that the "Choose Language" section (comes first in the installer) during the install process didn't work so i just continued with the next step.

steven@box:~$ cat /etc/default/locale
# File generated by update-locale
LANG="C"

steven@box:~$ locale -a
C
C.UTF-8
POSIX

steven@box:~$ locale
LANG=C
LANGUAGE=en
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks! The fact that you couldn't choose language in the installer seems to be either a bug in the installer or something related to the other bug report I mentioned. Hopefully it will be fine in a few days.

Anyway, to fix it for yourself now, you can run this terminal command:

im-config -n none

That ought to allow you to open and use Language Support.

Even if this is an oddity, the language-selector package should be able to handle it without crashing. I'm going to fix it in language-selector in the beginning of the 18.04 development cycle.

Changed in language-selector (Ubuntu):
milestone: none → ubuntu-18.04
status: Incomplete → Triaged
sourcepower (sourcepower) wrote :

Thank you for the help. I didn't execute "im-config -n none" instead i did the following.

- enable the needed locales (= uncomment it)

sudo vi /etc/locale.gen
...
de_DE.UTF-8 UTF-8
en_US.UTF-8 UTF-8
...

sudo locale-gen

- set the system language to en_US.UTF-8

sudo update-locale LANG=en_US.UTF-8

- reboot the system
- results

steven@box:~$ locale -a
C
C.UTF-8
de_DE.utf8
en_US.utf8
POSIX
steven@box:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Gunnar Hjalmarsson (gunnarhj) wrote :

Ok, that's a more robust fix than I proposed. /etc/default/locale should always have a valid UTF-8 locale assigned to LANG.

Btw, if you after that opened Language Support, the command "im-config -n none" was probably executed behind the scenes anyway. ;)

Changed in language-selector (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package language-selector - 0.181

---------------
language-selector (0.181) bionic; urgency=medium

  * LanguageSelector/LocaleInfo.py:
    Adapt to changed syntax in ~/.pam_environment (LP: #1722151).
  * LanguageSelector/ImConfig.py:
    Prevent crash if LC_CTYPE is 'C' (LP: #1723318).
  * debian/control:
    Bump Standards-Version to 4.1.1.

 -- Gunnar Hjalmarsson <email address hidden> Fri, 27 Oct 2017 19:40:00 +0200

Changed in language-selector (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers