rpm-software-management / spec-cleaner

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

TypeError: sequence item 0: expected string, int found #103

Closed toabctl closed 8 years ago

toabctl commented 8 years ago

When installing via pypi and trying to process this snippet:

%global sname oslo.serialization

Name:          python-oslo.serialization
Version:       2.4.0
Release:       0
Summary:       OpenStack serialization library
Group:         Development/Languages
License:       Apache-2.0
Url:           https://launchpad.net/%{sname}
Source0:       https://pypi.python.org/packages/source/o/%{sname}/%{sname}-%{version}.tar.gz
BuildRequires: openstack-macros
BuildRequires: python-devel
BuildRequires: python-mock
BuildRequires: python-netaddr >= 0.7.12
BuildRequires: python-oslotest
BuildRequires: python-oslo.i18n
BuildRequires: python-pbr
BuildRequires: python-setuptools
BuildRequires: python-oslo.utils >= 3.5.0
Requires:      python-Babel >= 1.3
Requires:      python-msgpack-python >= 0.4.0
Requires:      python-oslo.utils >= 3.5.0
Requires:      python-pytz >= 2013.6
Requires:      python-six >= 1.9.0
BuildArch:     noarch

%description
The oslo.serialization library provides support for representing objects
in transmittable and storable formats, such as Base64, JSON and MessagePack.

%package doc
Summary:       Documentation for OpenStack serialization library
BuildRequires: python-oslosphinx >= 2.3.0
BuildRequires: python-Sphinx

%description doc
The oslo.serialization library provides support for representing objects
in transmittable and storable formats, such as Base64, JSON and MessagePack.
This package contains the documentation.

%prep
%setup -q -n %{sname}-%{version}

%build
%{__python2} setup.py build

# generate html docs
%{__python2} setup.py build_sphinx
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}

%install
%{__python2} setup.py install --prefix=%{_prefix} --root=%{buildroot}

%check
testr init && testr run

%files
%license LICENSE
%doc README.rst AUTHORS ChangeLog
%{python2_sitelib}/oslo_serialization
%{python2_sitelib}/*.egg-info

%files doc
%license LICENSE
%doc doc/build/html

%changelog

I get:

$ spec-cleaner logs/oslo.serialization.spec.j2.suse 
Traceback (most recent call last):
  File "/home/tom/devel/openstack/rpm-packaging/.tox/speccleaner/bin/spec-cleaner", line 11, in <module>
    sys.exit(main())
  File "/home/tom/devel/openstack/rpm-packaging/.tox/speccleaner/lib/python2.7/site-packages/spec_cleaner/__init__.py", line 98, in main
    sys.stderr.write('ERROR: {0}\n'.format(exception))
  File "/home/tom/devel/openstack/rpm-packaging/.tox/speccleaner/lib/python2.7/site-packages/spec_cleaner/rpmexception.py", line 15, in __str__
    return ''.join(self.args)
TypeError: sequence item 0: expected string, int found
scarabeusiv commented 8 years ago

It threw exception, and then the exception message was int not string...

I can't even get it to throw me the exception it just works. What system is it running?

scarabeusiv commented 8 years ago

Even in virtualenv it seems to work just fine here from pip.

toabctl commented 8 years ago

I can't even get it to throw me the exception it just works. What system is it running?

openSUSE Tumbleweed

scarabeusiv commented 8 years ago

Okay, in that case I dunno why it works for me. Could you email me the exact file? Maybe there is some whitespace/non-visible character that breaks it.

toabctl commented 8 years ago

Hm. Can not find the file I used. And when I recreate the file, I can not reproduce the error. So works now. Sorry for the noise.

scarabeusiv commented 8 years ago

No biggie. Just feel free to attach the files asap you notice something is amiss. I fixed the %license bracketing thanks to this so it was not completely pointless :P