#713 invalid keyword cmp in python3 list.sort() and sorted()
Closed: Fixed 6 years ago Opened 6 years ago 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 f79cab8 relates to this ticket

Commit 8da5f2b relates to this ticket

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

6 years ago

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

6 years ago

@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)

6 years ago

[PR#714 add new patches to fix all issues

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

6 years ago

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

6 years ago

Commit 2c04c4f relates to this ticket

Login to comment on this ticket.

Metadata