# Buggy code
def process_csv_row(row):
    cleaned_path = posix_normpath("%s%s%s" % (sp_dir, path_prepender, row[0]))
    if len(row) == 3:
        checksum, size = row[1:]
        if checksum:
            assert checksum.startswith("sha256="), (
                self._metadata_dir_full_path,
                cleaned_path,
                checksum,
            )
            checksum = checksum[7:]
        else:
            checksum = None
        size = int(size) if size else None
    else:
        checksum = size = None
    return cleaned_path, checksum, size


# Traceback (TypeError)
conda create --yes -n py-3.7 python==3.7
conda activate py-3.7
pip install jeepney==0.4.1
conda list

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
File "/home/bago/conda/lib/python3.7/site-packages/conda/exceptions.py", line 1003, in __call__
return func(*args, **kwargs)
File "/home/bago/conda/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main
exit_code = do_call(args, p)
File "/home/bago/conda/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/bago/conda/lib/python3.7/site-packages/conda/cli/main_list.py", line 142, in execute
show_channel_urls=context.show_channel_urls)
File "/home/bago/conda/lib/python3.7/site-packages/conda/cli/main_list.py", line 80, in print_packages
show_channel_urls=show_channel_urls)
File "/home/bago/conda/lib/python3.7/site-packages/conda/cli/main_list.py", line 45, in list_packages
installed = sorted(PrefixData(prefix, pip_interop_enabled=True).iter_records(),
File "/home/bago/conda/lib/python3.7/site-packages/conda/core/prefix_data.py", line 117, in iter_records
return itervalues(self._prefix_records)
File "/home/bago/conda/lib/python3.7/site-packages/conda/core/prefix_data.py", line 146, in _prefix_records
return self.__prefix_records or self.load() or self.__prefix_records
File "/home/bago/conda/lib/python3.7/site-packages/conda/core/prefix_data.py", line 70, in load
self._load_site_packages()
File "/home/bago/conda/lib/python3.7/site-packages/conda/core/prefix_data.py", line 261, in _load_site_packages
python_record = read_python_record(self.prefix_path, af, python_pkg_record.version)
File "/home/bago/conda/lib/python3.7/site-packages/conda/gateways/disk/read.py", line 253, in read_python_record
paths_tups = pydist.get_paths()
File "/home/bago/conda/lib/python3.7/site-packages/conda/common/pkg_formats/python.py", line 268, in get_paths
records = sorted(concatv(records, ((pf, None, None) for pf in missing_pyc_files)))
TypeError: '<' not supported between instances of 'NoneType' and 'str'

`$ /home/bago/conda/bin/conda list`

# Fixed code
def process_csv_row(reader):
    seen = []
    records = []
    for row in reader:
        cleaned_path = posix_normpath("%s%s%s" % (sp_dir, path_prepender, row[0]))
        if len(row) == 3:
            checksum, size = row[1:]
            if checksum:
                assert checksum.startswith("sha256="), (
                    self._metadata_dir_full_path,
                    cleaned_path,
                    checksum,
                )
                checksum = checksum[7:]
            else:
                checksum = None
            size = int(size) if size else None
        else:
            checksum = size = None
        if cleaned_path not in seen and row[0]:
            seen.append(cleaned_path)
            records.append((cleaned_path, checksum, size))
        else:
            continue
    return tuple(records)