1. jasuca
  2. whoosh


Matt Chaput  committed dbe3638

Force keys to be str before using a dict as **kwargs. Fixes issue #157.
I'm not sure in what Python version match.groupdict() produces unicode keys (I couldn't reproduce it) but the fix is harmless.

  • Participants
  • Parent commits 3e8786b
  • Branches default

Comments (0)

Files changed (1)

File src/whoosh/qparser/plugins.py

View file
         return ()
     def create(self, parser, match):
-        kwargs = match.groupdict()
+        # Groupdict keys can be unicode sometimes apparently? Convert them to
+        # str for use as keyword arguments. This should be Py3-safe.
+        kwargs = dict((str(k), v) for k, v in iteritems(match.groupdict()))
         return self.nodetype(**kwargs)