# Buggy code
def process_unix(self, file, family, inodes, filter_pid=None):
    """Parse /proc/net/unix files."""
    with open_text(file, buffering=BIGGER_FILE_BUFFERING) as f:
        f.readline()  # skip the first line
        for line in f:
            tokens = line.split()
            try:
                _, _, _, _, type_, _, inode = tokens[0:7]
            except ValueError:
                raise RuntimeError(
                    "error while parsing %s; malformed line %r" % (file, line)
                )
            if inode in inodes:
                # With UNIX sockets we can have a single inode
                # referencing many file descriptors.
                pairs = inodes[inode]
            else:
                pairs = [(None, -1)]
            for pid, fd in pairs:
                if filter_pid is not None and filter_pid != pid:
                    continue
                else:
                    if len(tokens) == 8:
                        path = tokens[-1]
                    else:
                        path = ""
                    type_ = int(type_)
                    raddr = None
                    status = _common.CONN_NONE
                    yield (fd, family, type_, path, raddr, status, pid)


# Traceback (ValueError)
Could not find neovim socket error while parsing /proc/net/unix; malformed line '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\n'
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/psutil-3.2.0-py3.4-linux-x86_64.egg/psutil/_pslinux.py", line 525, in process_unix
_, _, _, _, type_, _, inode = tokens[0:7]
ValueError: need more than 1 value to unpack

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/teto/.i3/i3dispatch.py", line 115, in get_nvim_socket
unix_sockets = child.connections(kind="unix")
File "/usr/local/lib/python3.4/dist-packages/psutil-3.2.0-py3.4-linux-x86_64.egg/psutil/__init__.py", line 1010, in connections
return self._proc.connections(kind)
File "/usr/local/lib/python3.4/dist-packages/psutil-3.2.0-py3.4-linux-x86_64.egg/psutil/_pslinux.py", line 722, in wrapper
return fun(self, *args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/psutil-3.2.0-py3.4-linux-x86_64.egg/psutil/_pslinux.py", line 1178, in connections
ret = _connections.retrieve(kind, self.pid)
File "/usr/local/lib/python3.4/dist-packages/psutil-3.2.0-py3.4-linux-x86_64.egg/psutil/_pslinux.py", line 568, in retrieve
for fd, family, type_, laddr, raddr, status, bound_pid in ls:
File "/usr/local/lib/python3.4/dist-packages/psutil-3.2.0-py3.4-linux-x86_64.egg/psutil/_pslinux.py", line 529, in process_unix
file, line))
RuntimeError: error while parsing /proc/net/unix; malformed line '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\n'

# Fixed code
def process_unix(self, file, family, inodes, filter_pid=None):
    """Parse /proc/net/unix files."""
    with open_text(file, buffering=BIGGER_FILE_BUFFERING) as f:
        f.readline()  # skip the first line
        for line in f:
            tokens = line.split()
            try:
                _, _, _, _, type_, _, inode = tokens[0:7]
            except ValueError:
                if " " not in line:
                    # see: https://github.com/giampaolo/psutil/issues/766
                    continue
                raise RuntimeError(
                    "error while parsing %s; malformed line %r" % (file, line)
                )
            if inode in inodes:
                # With UNIX sockets we can have a single inode
                # referencing many file descriptors.
                pairs = inodes[inode]
            else:
                pairs = [(None, -1)]
            for pid, fd in pairs:
                if filter_pid is not None and filter_pid != pid:
                    continue
                else:
                    if len(tokens) == 8:
                        path = tokens[-1]
                    else:
                        path = ""
                    type_ = int(type_)
                    raddr = None
                    status = _common.CONN_NONE
                    yield (fd, family, type_, path, raddr, status, pid)