Bug 1218023

Summary: [abrt] ibus-table: posixpath.py:83:join:TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
Product: [Fedora] Fedora Reporter: Vladimir Netanyahu <netanyahu>
Component: ibus-tableAssignee: Mike FABIAN <mfabian>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: dchen, i18n-bugs, K9, kent.neo, laurent.rineau__fedora, lewishyu, mfabian, netanyahu, pwu, samuel_lee_1991, shawn.p.huang
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/328298619894add6c22a16f5299c041320bf267f
Whiteboard: abrt_hash:e53691b5dac8b731dcf9daff4cd83fb65dc98cf3
Fixed In Version: ibus-table-1.9.6-1.fc22 ibus-table-1.9.8-1.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-13 02:52:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: dead.letter
none
File: environ none

Description Vladimir Netanyahu 2015-05-04 03:37:36 UTC
Version-Release number of selected component:
ibus-table-1.9.4-1.fc21

Additional info:
reporter:       libreport-2.3.0
cmdline:        /usr/bin/python3 /usr/share/ibus-table/engine/main.py --xml
executable:     /usr/share/ibus-table/engine/main.py
kernel:         3.19.4-200.fc21.x86_64
runlevel:       N 5
type:           Python3
uid:            0

Truncated backtrace:
posixpath.py:83:join:TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

Traceback (most recent call last):
  File "/usr/share/ibus-table/engine/main.py", line 32, in <module>
    import factory
  File "/usr/share/ibus-table/engine/factory.py", line 27, in <module>
    import tabsqlitedb
  File "/usr/share/ibus-table/engine/tabsqlitedb.py", line 36, in <module>
    import ibus_table_location
  File "/usr/share/ibus-table/engine/ibus_table_location.py", line 93, in <module>
    __module_init = __ModuleInitializer()
  File "/usr/share/ibus-table/engine/ibus_table_location.py", line 87, in __init__
    _init()
  File "/usr/share/ibus-table/engine/ibus_table_location.py", line 67, in _init
    ibus_table_location['data_home'] = os.path.join(os.getenv('HOME'), '.local/share')
  File "/usr/lib64/python3.4/posixpath.py", line 83, in join
    path += b
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

Local variables in innermost frame:
b: '.local/share'
p: ('.local/share',)
path: None
sep: '/'
a: None
valid_types: False

Potential duplicate: bug 1088138

Comment 1 Vladimir Netanyahu 2015-05-04 03:37:41 UTC
Created attachment 1021494 [details]
File: backtrace

Comment 2 Vladimir Netanyahu 2015-05-04 03:37:42 UTC
Created attachment 1021495 [details]
File: dead.letter

Comment 3 Vladimir Netanyahu 2015-05-04 03:37:44 UTC
Created attachment 1021496 [details]
File: environ

Comment 4 Mike FABIAN 2015-05-06 08:41:42 UTC
commit 877e6059ceeb667d0a754c7acbcf630c49bbe2e3
Author: Mike FABIAN <mfabian>
Date:   Wed May 6 08:26:20 2015 +0200

    Use os.path.expanduser('~') instead of os.getenv('HOME')
    
    Resolves: rhbz#1218023 - [abrt] ibus-table: posixpath.py:83:join:TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
    See: https://bugzilla.redhat.com/show_bug.cgi?id=1218023
    
    The Python documentation says:
    
     os.path.expanduser(path)
    
        On Unix and Windows, return the argument with an initial component
        of ~ or ~user replaced by that user‘s home directory.
    
        On Unix, an initial ~ is replaced by the environment variable HOME
        if it is set; otherwise the current user’s home directory is
        looked up in the password directory through the built-in module
        pwd. An initial ~user is looked up directly in the password
        directory.
    
    This helps if HOME is not set.

diff --git a/engine/ibus_table_location.py b/engine/ibus_table_location.py
index 03dae37..9c5bd67 100644
--- a/engine/ibus_table_location.py
+++ b/engine/ibus_table_location.py
@@ -64,7 +64,7 @@ def _init():
     if not ibus_table_location['data_home'] or not os.path.exists(ibus_table_location['data_home']):
         ibus_table_location['data_home'] = os.getenv('XDG_DATA_HOME')
     if not ibus_table_location['data_home'] or not os.path.exists(ibus_table_location['data_home']):
-        ibus_table_location['data_home'] = os.path.join(os.getenv('HOME'), '.local/share')
+        ibus_table_location['data_home'] = os.path.expanduser('~/.local/share')
     ibus_table_location['data_home'] = os.path.join(ibus_table_location['data_home'], 'ibus-table')
     if not os.access(ibus_table_location['data_home'], os.F_OK):
         os.makedirs(ibus_table_location['data_home'])
@@ -77,7 +77,7 @@ def _init():
     if not ibus_table_location['cache_home'] or not os.path.exists(ibus_table_location['cache_home']):
         ibus_table_location['cache_home'] = os.getenv('XDG_CACHE_HOME')
     if not ibus_table_location['cache_home'] or not os.path.exists(ibus_table_location['cache_home']):
-       ibus_table_location['cache_home'] = os.path.join(os.getenv('HOME'), '.cache')
+        ibus_table_location['cache_home'] = os.path.expanduser('~/.cache')
     ibus_table_location['cache_home'] = os.path.join(ibus_table_location['cache_home'], 'ibus-table')
     if not os.access(ibus_table_location['cache_home'], os.F_OK):
         os.makedirs(ibus_table_location['cache_home'])

Comment 5 Fedora Update System 2015-05-06 13:38:23 UTC
ibus-table-1.9.6-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/ibus-table-1.9.6-1.fc21

Comment 6 Fedora Update System 2015-05-06 13:39:01 UTC
ibus-table-1.9.6-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/ibus-table-1.9.6-1.fc20

Comment 7 Fedora Update System 2015-05-06 13:39:43 UTC
ibus-table-1.9.6-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/ibus-table-1.9.6-1.fc22

Comment 8 Fedora Update System 2015-05-10 23:35:40 UTC
Package ibus-table-1.9.6-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ibus-table-1.9.6-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-7757/ibus-table-1.9.6-1.fc20
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2015-05-26 03:30:01 UTC
ibus-table-1.9.6-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2015-10-14 15:48:04 UTC
ibus-table-1.9.7-1.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-f6cf35bc3d

Comment 11 Fedora Update System 2015-10-15 05:21:09 UTC
ibus-table-1.9.7-1.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update ibus-table'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-f6cf35bc3d

Comment 12 Fedora Update System 2015-10-21 07:56:24 UTC
ibus-table-1.9.8-1.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-9e109344ba

Comment 13 Fedora Update System 2015-10-26 10:28:03 UTC
ibus-table-1.9.8-1.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update ibus-table'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-9e109344ba

Comment 14 Fedora End Of Life 2015-11-04 16:00:53 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. 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 '21'.

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 21 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 15 Fedora Update System 2015-11-13 02:52:19 UTC
ibus-table-1.9.8-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.