Page 1 of 1

Error: TypeError: argument of type 'int' is not iterable

Posted: February 6th, 2017, 7:50 pm
by denis300
Does anyone know how to solve this? I assume i have to change something on my machine (running gentoo)

Code: Select all

Traceback (most recent call last):
  File "/usr/share/sabnzbd/SABnzbd.py", line 1788, in <module>
    main()
  File "/usr/share/sabnzbd/SABnzbd.py", line 1335, in main
    hosts = all_localhosts()
  File "/usr/share/sabnzbd/SABnzbd.py", line 496, in all_localhosts
    if item not in ips and ('::1' not in item or sabnzbd.cfg.ipv6_hosting()):
TypeError: argument of type 'int' is not iterable

full code:

Code: Select all

def all_localhosts():
    """ Return all unique values of localhost in order of preference """
    ips = ['127.0.0.1']
    try:
        # Check whether IPv6 is available and enabled
        info = socket.getaddrinfo('::1', None)
        af, socktype, proto, _canonname, _sa = info[0]
        s = socket.socket(af, socktype, proto)
        s.close()
    except socket.error:
        return ips
    try:
        info = socket.getaddrinfo('localhost', None)
    except:
        # localhost does not resolve
        return ips
    ips = []
    for item in info:
        item = item[4][0]
        # Only return IPv6 when enabled
        if item not in ips and ('::1' not in item or sabnzbd.cfg.ipv6_hosting()):
            ips.append(item)
    return ips

SOLVED: culprit was ::1 aliased to localhost in /etc/hosts

Re: Error starting

Posted: February 7th, 2017, 1:32 am
by sander
So this happens on Gentoo Linux ... ?

Please run this:

Code: Select all

python2.7 -c "import socket; print socket.getaddrinfo('localhost')"

Code: Select all

python2.7 -c "import socket; print socket.getaddrinfo('localhost', None, socket.AF_INET)"
... and post the output here

The same was reported by a FreeBSD user here: https://forums.sabnzbd.org/viewtopic.php?f=23&t=22392
I think we found a real solution in SABnzbd.