softwarefactory-project / rdopkg

power to the packagers
Apache License 2.0
28 stars 21 forks source link

specfile.py checks len() of filter #170

Closed ktdreyer closed 5 years ago

ktdreyer commented 5 years ago

The specfile get_source_urls() method works on Python 2, but fails on Python 3. Here's a sample script:

from rdopkg.utils import specfile

spec = specfile.Spec()
urls = spec.get_source_urls()
print(urls)
$ python2 testbug.py 
['https://download.ceph.com/tarballs/ceph-12.2.8.tar.gz']
$ python3 testbug.py 
Traceback (most recent call last):
  File "testbug.py", line 5, in <module>
    urls = spec.get_source_urls()
  File "/usr/lib/python3.7/site-packages/rdopkg/utils/specfile.py", line 667, in get_source_urls
    if len(sources) == 0:
TypeError: object of type 'filter' has no len()

Probably need a list comprehension here instead.

yac commented 5 years ago

Ooops, https://softwarefactory-project.io/r/#/c/15539/