vstinner / hachoir

Hachoir is a Python library to view and edit a binary stream field by field
http://hachoir.readthedocs.io/
GNU General Public License v2.0
604 stars 70 forks source link

hachoir-grep: TypeError: decoding str is not supported #82

Closed jwilk closed 1 year ago

jwilk commented 1 year ago
$ hachoir-grep foo tests/files/*.png
Traceback (most recent call last):
  File "/home/jwilk/.local/bin/hachoir-grep", line 8, in <module>
    sys.exit(main())
  File "/home/jwilk/.local/lib/python3.8/site-packages/hachoir/grep.py", line 183, in main
    values, pattern, filenames = parseOptions()
  File "/home/jwilk/.local/lib/python3.8/site-packages/hachoir/grep.py", line 66, in parseOptions
    pattern = str(arguments[0], "ascii")
TypeError: decoding str is not supported

(originally reported by Samuel Thibault in https://bugs.debian.org/969914)

vstinner commented 1 year ago

Oh, right. Thanks for your bug report.

Fixed by https://github.com/vstinner/hachoir/commit/e41df664ebc5b951315f8a80649627547d9ce7fe

vstinner commented 1 year ago

I released Hachoir 3.2.0 with the fix. Enjoy!