Skip to content

Rare failure in read_byte_as_int #2

Description

@ParzivalWolfram

With some ROMs, it's possible for read_byte_as_int to fail as such:

Traceback (most recent call last):
  File "/tmp/sega_genesis_checksum_utility.py", line 192, in <module>
    main()
  File "/tmp/sega_genesis_checksum_utility.py", line 40, in main
    computed_checksum = compute_checksum(genesis_file)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/sega_genesis_checksum_utility.py", line 171, in compute_checksum
    word = read_word_as_int(open_file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/sega_genesis_checksum_utility.py", line 101, in read_word_as_int
    low_bits = read_byte_as_int(open_file)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/sega_genesis_checksum_utility.py", line 88, in read_byte_as_int
    return ord(open_file.read(1))
           ^^^^^^^^^^^^^^^^^^^^^^
TypeError: ord() expected a character, but string of length 0 found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions