rpm-software-management / spec-cleaner

spec-cleaner
BSD 3-Clause "New" or "Revised" License
28 stars 34 forks source link

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' #170

Closed toabctl closed 7 years ago

toabctl commented 7 years ago

We use spec-cleaner in the OpenStack packaging project and when running it in a tox env, I get:

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Traceback (most recent call last):
  File "/home/tom/devel/openstack/rpm-packaging/.tox/lint/bin/spec-cleaner", line 11, in <module>
    sys.exit(main())
  File "/home/tom/devel/openstack/rpm-packaging/.tox/lint/lib/python2.7/site-packages/spec_cleaner/__init__.py", line 107, in main
    cleaner = RpmSpecCleaner(options)
  File "/home/tom/devel/openstack/rpm-packaging/.tox/lint/lib/python2.7/site-packages/spec_cleaner/rpmcleaner.py", line 53, in __init__
    self.options['unbrace_keywords'] = self._unbrace_keywords()
  File "/home/tom/devel/openstack/rpm-packaging/.tox/lint/lib/python2.7/site-packages/spec_cleaner/rpmcleaner.py", line 112, in _unbrace_keywords
    keywords = load_keywords_whitelist()
  File "/home/tom/devel/openstack/rpm-packaging/.tox/lint/lib/python2.7/site-packages/spec_cleaner/rpmhelpers.py", line 35, in load_keywords_whitelist
    files.open_datafile(BRACKETING_EXCLUDES)
  File "/home/tom/devel/openstack/rpm-packaging/.tox/lint/lib/python2.7/site-packages/spec_cleaner/fileutils.py", line 26, in open_datafile
    homedir = os.getenv('HOME') + '/.local/'
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
scarabeusiv commented 7 years ago

Hmm why the HOME env is not actually propagated in your environment? Shouldn't this be done by the passenv= for the tox?

scarabeusiv commented 7 years ago

Could you try this commit?

mimi1vx commented 7 years ago

@scarabeusiv we have passenv = * , so probadly in @toabctl env is $HOME unset

scarabeusiv commented 7 years ago

This should be fixed in 0.9.3.