sylikc / pyexiftool

PyExifTool (active PyPI project) - A Python library to communicate with an instance of Phil Harvey's ExifTool command-line application. Runs one process with special -stay_open flag, and pipes data to/from. Much more efficient than running a subprocess for each command!
Other
148 stars 19 forks source link

Reading all tags from no files #37

Closed jangop closed 2 years ago

jangop commented 2 years ago

The test https://github.com/sylikc/pyexiftool/blob/3889b77abd4ef5463a17befb37cbb8af0f058ea0/tests/test_helper.py#L30 fails. This used to be (I think) because https://github.com/sylikc/pyexiftool/blob/3889b77abd4ef5463a17befb37cbb8af0f058ea0/exiftool/helper.py#L123 returned None instead of [] but, looking at the source, apparently it (or rather get_tags) now raises TypeError if files evaluates to False (which both None and [] do).

Should that (raising TypeError) continue to be the expected behavior? If, so we should modify the test accordingly and adjust the docstring of get_metadata.

sylikc commented 2 years ago

I just fixed the test on this one with 715cfc818d93fca46a2079cb739cf4ca3cf3558e . I changed it to a ValueError instead of a TypeError though... which seemed to make more sense...