# Buggy code
def get_paths(self):
    """
    Read the list of installed paths from record or source file.

    Example
    -------
    [(u'skdata/__init__.py', u'sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU', 0),
     (u'skdata/diabetes.py', None, None),
     ...
    ]
    """
    manifest_full_path = self.manifest_full_path
    if manifest_full_path:
        python_version = self.python_version
        sp_dir = get_python_site_packages_short_path(python_version) + "/"
        prepend_metadata_dirname = basename(manifest_full_path) == "installed-files.txt"
        if prepend_metadata_dirname:
            path_prepender = basename(dirname(manifest_full_path)) + "/"
        else:
            path_prepender = ""

        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

        csv_delimiter = ","
        if PY2:
            csv_delimiter = csv_delimiter.encode("utf-8")
        with open(manifest_full_path) as csvfile:
            record_reader = csv_reader(csvfile, delimiter=csv_delimiter)
            # format of each record is (path, checksum, size)
            records = tuple(process_csv_row(row) for row in record_reader if row[0])
        files_set = set(record[0] for record in records)

        _pyc_path, _py_file_re = pyc_path, PY_FILE_RE
        py_ver_mm = get_major_minor_version(python_version, with_dot=False)
        missing_pyc_files = (
            ff
            for ff in (
                _pyc_path(f, py_ver_mm) for f in files_set if _py_file_re.match(f)
            )
            if ff not in files_set
        )
        records = sorted(
            concatv(records, ((pf, None, None) for pf in missing_pyc_files))
        )
        return records

    return []


# 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 get_paths(self):
    """
    Read the list of installed paths from record or source file.

    Example
    -------
    [(u'skdata/__init__.py', u'sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU', 0),
     (u'skdata/diabetes.py', None, None),
     ...
    ]
    """
    manifest_full_path = self.manifest_full_path
    if manifest_full_path:
        python_version = self.python_version
        sp_dir = get_python_site_packages_short_path(python_version) + "/"
        prepend_metadata_dirname = basename(manifest_full_path) == "installed-files.txt"
        if prepend_metadata_dirname:
            path_prepender = basename(dirname(manifest_full_path)) + "/"
        else:
            path_prepender = ""

        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)

        csv_delimiter = ","
        if PY2:
            csv_delimiter = csv_delimiter.encode("utf-8")
        with open(manifest_full_path) as csvfile:
            record_reader = csv_reader(csvfile, delimiter=csv_delimiter)
            # format of each record is (path, checksum, size)
            records = process_csv_row(record_reader)
        files_set = set(record[0] for record in records)

        _pyc_path, _py_file_re = pyc_path, PY_FILE_RE
        py_ver_mm = get_major_minor_version(python_version, with_dot=False)
        missing_pyc_files = (
            ff
            for ff in (
                _pyc_path(f, py_ver_mm) for f in files_set if _py_file_re.match(f)
            )
            if ff not in files_set
        )
        records = sorted(
            concatv(records, ((pf, None, None) for pf in missing_pyc_files))
        )
        return records

    return []