Library causes infinite loop

Started by Danatr, February 26, 2024, 07:26:56 AM

Previous topic - Next topic

Danatr

After a lot of debug I saw the following lines inside exiftool.py:
    while not _get_buffer_end(output_list, endswith_count).strip().endswith(b_endswith):
        if constants.PLATFORM_WINDOWS:
            # windows does not support select() for anything except sockets
            # https://docs.python.org/3.7/library/select.html
            output_list.append(os.read(fd, block_size))
        else:  # pytest-cov:windows: no cover
            # this does NOT work on windows... and it may not work on other systems... in that case, put more things to use the original code above
            inputready, outputready, exceptready = select.select([fd], [], [])
            for i in inputready:
                if i == fd:
                    output_list.append(os.read(fd, block_size))

    return b"".join(output_list)

I saw that my app crashes because this causes an infinite loop
It happens only after I wrap my python script as an application and only when I use it with double-clicking on it..
Im using mac and exiftool version is 12.77
Any ideas?

StarGeek

Exiftool is written in Perl, not Python.  You will have to contact the author of the exiftool.py code.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).