koniu / recoll-webui

web interface for recoll desktop search
266 stars 55 forks source link

Internal Server Error | File contains parsing errors: <???> #1

Closed wonx closed 11 years ago

wonx commented 11 years ago

I was going to try to code a simple webserver for Recoll, which is a great tool, when a quick google search showed me that you had the same idea before me. Great then!

Anyway, I tried your webserver, but it doesn't work for me. Just going to http://localhost:8080 shows a "Error 500: Internal Server Error". I suspect it might be caused by the use of non-international characters (like àèíóóú). Here it is content of the error:

Exception:

File contains parsing errors: <???>
    [line 13]: '"/home/user/Documents/Apunts/Llic. Psicologia" "/home/user/D\\\n'
    [line 14]: 'ocuments/Apunts/M\xc3\xa0ster en Psicologia Cl\xc3\xadnica i de la Salut\\\n'
    [line 15]: '" /home/user/Documents/eBooks/Psico /home/user/Documents/eBo\\\n'
    [line 16]: 'oks/Psicologia\n'
    [line 19]: 'rors .zotero-ft-cache *~ #* bin Cache cache* caughtspam CVS \\\n'
    [line 20]: 'loop.ps recoll.conf recollrc tmp xapiandb\n'

Traceback:

Traceback (most recent call last):
  File "/home/user/Baixades/recoll-webui-master/bottle.py", line 744, in _handle
    return route.call(**args)
  File "/home/user/Baixades/recoll-webui-master/bottle.py", line 1479, in wrapper
    rv = callback(*a, **ka)
  File "/home/user/Baixades/recoll-webui-master/bottle.py", line 2850, in wrapper
    result = func(*args, **kwargs)
  File "/home/user/Baixades/recoll-webui-master/webui.py", line 212, in main
    config = get_config()
  File "/home/user/Baixades/recoll-webui-master/webui.py", line 117, in get_config
    config['confdir'], rc = recoll_get_config()
  File "/home/user/Baixades/recoll-webui-master/webui.py", line 104, in recoll_get_config
    rc_ini.readfp(rc_ini_fp)
  File "/usr/lib/python2.7/ConfigParser.py", line 324, in readfp
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read
    raise e
ParsingError: File contains parsing errors: <???>
    [line 13]: '"/home/user/Documents/Apunts/Llic. Psicologia" "/home/user/D\\\n'
    [line 14]: 'ocuments/Apunts/M\xc3\xa0ster en Psicologia Cl\xc3\xadnica i de la Salut\\\n'
    [line 15]: '" /home/user/Documents/eBooks/Psico /home/user/Documents/eBo\\\n'
    [line 16]: 'oks/Psicologia\n'
    [line 19]: 'rors .zotero-ft-cache *~ #* bin Cache cache* caughtspam CVS \\\n'
    [line 20]: 'loop.ps recoll.conf recollrc tmp xapiandb\n'
koniu commented 11 years ago

In fact it looks like Recoll splits lines in recoll.conf using a forward slash, something that ConfigParser is not prepared to swallow. Pushed a fix which hopefully resolves the issue. Can you pull and let me know if it works now?

wonx commented 11 years ago

It works now, thanks!