[Python-modules-team] Bug#969914: hachoir-grep completely fails

Samuel Thibault sthibault at debian.org
Tue Sep 8 20:19:08 BST 2020


Package: hachoir
Version: 3.1.0+dfsg-1
Severity: normal

hachoir-grep doesn't work at all:

$ hachoir-grep JFIF test.jpg
Traceback (most recent call last):
  File "/usr/bin/hachoir-grep", line 11, in <module>
    load_entry_point('hachoir==3.1.0', 'console_scripts', 'hachoir-grep')()
  File "/usr/lib/python3/dist-packages/hachoir/grep.py", line 184, in main
    values, pattern, filenames = parseOptions()
  File "/usr/lib/python3/dist-packages/hachoir/grep.py", line 67, in parseOptions
    pattern = str(arguments[0], "ascii")
TypeError: decoding str is not supported

I had to use the attached patch to fix it. It looks like a python2 vs
python3 issue.

Samuel

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 'proposed-updates'), (500, 'oldoldstable'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.8.0 (SMP w/8 CPU threads)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages hachoir depends on:
ii  python3           3.8.2-3
ii  python3-urwid     2.1.1-1
ii  python3-wxgtk4.0  4.0.7+dfsg-6

hachoir recommends no packages.

hachoir suggests no packages.

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/lib/python3/dist-packages/hachoir/grep.py (from hachoir package)
-------------- next part --------------
diff --git a/hachoir/grep.py b/hachoir/grep.py
index 4a84d93..fb327cb 100644
--- a/hachoir/grep.py
+++ b/hachoir/grep.py
@@ -63,7 +63,7 @@ def parseOptions():
         if len(arguments) < 2:
             parser.print_help()
             sys.exit(1)
-        pattern = str(arguments[0], "ascii")
+        pattern = arguments[0]
         filenames = arguments[1:]
     return values, pattern, filenames
 


More information about the Python-modules-team mailing list