#713 invalid keyword cmp in python3 list.sort() and sorted()
Closed: Fixed Opened by franzh.

The keywork 'cmp' was used for list.sort()/sorted() in Python2, however it has been removed in Python3. In order to support both Python2/Python3, we need to rewrite compare functions.


cmp appears in these places:
./hub/kojihub.py:2425:
artifacts = sorted(artifacts, cmp=lambda a, b: rpm.labelCompare(a, b))

./www/kojiweb/index.py:686:
values['output'] = sorted(paths, cmp = _sortByExtAndName)

./cli/koji_cli/commands.py:4520:
children.sort(cmp=lambda a, b: cmp(a['id'], b['id']))

[PR#714 for fixing ./cli/koji_cli/commands.py

Commit f79cab8c relates to this ticket

Commit 8da5f2bc relates to this ticket

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.16

Metadata Update from @tkopecek:
- Issue close_status updated to: Fixed

@tkopecek
There are still some files need to be patched:
./hub/kojihub.py:2425:
artifacts = sorted(artifacts, cmp=lambda a, b: rpm.labelCompare(a, b))

./www/kojiweb/index.py:686:
values['output'] = sorted(paths, cmp = _sortByExtAndName)

I think this issue should keep open.

Metadata Update from @tkopecek:
- Issue status updated to: Open (was: Closed)

[PR#714 add new patches to fix all issues

PR #744

Metadata Update from @tkopecek:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @tkopecek:
- Issue status updated to: Open (was: Closed)

Commit 45a5d3f9 fixes this issue

Commit be6dab46 fixes this issue

Commit 2c04c4f9 relates to this ticket

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/713

Please continue any further discussion there.

Metadata