#1205 Open files in binary mode instead of text mode when calculating the checksum
Closed: Fixed 3 years ago by tkopecek. Opened 5 years ago by mprahl.

In hub.kojihub:CG_Importer.prep_outputs, the checksum is calculated by opening the file using the default mode, which would be rt (read in text mode). This works fine for now, but when Koji eventually migrates to Python 3, the built-in open method [1] will automatically translate any non-UNIX line endings to \n. This means that any Windows line endings present in the file will be replaced, causing the checksum to be incorrect. My suggestion is to just read in binary mode to calculate the checksum instead.

1 - https://docs.python.org/3/library/functions.html#open


This may already be in the partial py3 hub work we have. I'll check

Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

3 years ago

It was fixed already as @mikem said.

Login to comment on this ticket.

Metadata