packetgeek / recoll-web-ui-template

Customized result.tpl template for recoll's web interface.
1 stars 1 forks source link

Template Causes Crash #1

Open stef204 opened 5 years ago

stef204 commented 5 years ago

Any chance you might look into it?

Using python 3.7.4 Recoll 1.25.16 + Xapian 1.4.12

Note: I can confirm that using the standard (original) result.tpl template works.

Internal Server Error

Exception:

TypeError("a bytes-like object is required, not 'str'")

Traceback:

Traceback (most recent call last):
  File "/home/$USER/Downloads/src/recollwebui-code/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/home/$USER/Downloads/src/recollwebui-code/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/home/$USER/Downloads/src/recollwebui-code/bottle.py", line 3643, in wrapper
    return template(tpl_name, **tplvars)
  File "/home/$USER/Downloads/src/recollwebui-code/bottle.py", line 3619, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/home/$USER/Downloads/src/recollwebui-code/bottle.py", line 3409, in render
    self.execute(stdout, env)
  File "/home/$USER/Downloads/src/recollwebui-code/bottle.py", line 3396, in execute
    eval(self.co, env)
  File "/home/$USER/Downloads/src/recollwebui-code/views/results.tpl", line 19, in <module>
    %include('result', d=res[i], i=i, query=query, config=config, query_string=query_string)
  File "/home/$USER/Downloads/src/recollwebui-code/bottle.py", line 3386, in _include
    return self.cache[_name].execute(env['_stdout'], env)
  File "/home/$USER/Downloads/src/recollwebui-code/bottle.py", line 3396, in execute
    eval(self.co, env)
  File "/home/$USER/Downloads/src/recollwebui-code/views/result.tpl", line 5, in <module>
    %url = d['url'].replace('file://', '')
TypeError: a bytes-like object is required, not 'str'
packetgeek commented 4 years ago

I'm thinking that the issue might be version specific. I've updated recoll twice and both times had to tweak the template.