View Single Post
Old 06-19-2018, 10:58 AM   #1
drawson1
Connoisseur
drawson1 began at the beginning.
 
Posts: 96
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
Python error when accessing content server with calibredb

I am running Calibre 3.25 on OpenSUSE 15.0 (it's the build from OpenSUSE, not from the Calibre site).

If I try to access the content server from the command-line with Calibre running like this:

/usr/bin/calibredb --with-library=http://localhost:8080/ --username=my_user --password=my_pass add epub/import/my_epub.epub

it fails with a python error:

Code:
Traceback (most recent call last):
  File "/usr/bin/calibredb", line 20, in <module>
    sys.exit(main())
  File "/usr/lib64/calibre/calibre/db/cli/main.py", line 254, in main
    return run_cmd(cmd, opts, args[1:], DBCtx(opts))
  File "/usr/lib64/calibre/calibre/db/cli/main.py", line 54, in run_cmd
    ret = m.main(opts, args, dbctx)
  File "/usr/lib64/calibre/calibre/db/cli/cmd_add.py", line 365, in main
    identifiers, lcodes, opts.filters
  File "/usr/lib64/calibre/calibre/db/cli/cmd_add.py", line 163, in do_add
    oidentifiers, olanguages
  File "/usr/lib64/calibre/calibre/db/cli/main.py", line 190, in run
    return self.remote_run(name, m, *args)
  File "/usr/lib64/calibre/calibre/db/cli/main.py", line 212, in remote_run
    res = self.br.open_novisit(rq)
  File "/usr/lib/python2.7/site-packages/mechanize/_mechanize.py", line 199, in open_novisit
    return self._mech_open(url, data, visit=False, timeout=timeout)
  File "/usr/lib/python2.7/site-packages/mechanize/_mechanize.py", line 230, in _mech_open
    response = UserAgentBase.open(self, request, data)
  File "/usr/lib/python2.7/site-packages/mechanize/_opener.py", line 193, in open
    response = urlopen(self, req, data)
  File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 344, in _open
    '_open', req)
  File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 1142, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 1115, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/lib64/python2.7/httplib.py", line 1042, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.7/httplib.py", line 1082, in _send_request
    self.endheaders(body)
  File "/usr/lib64/python2.7/httplib.py", line 1038, in endheaders
    self._send_output(message_body)
  File "/usr/lib64/python2.7/httplib.py", line 880, in _send_output
    msg += message_body
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9e in position 0: invalid start byte
I get the same error when doing other commands like "list". I can add books and do list queries from the command-line _without_ Calibre running with no problems.

One note - the system was upgraded from OpenSUSE 42.3 -> 15.0 a couple of weeks ago, and at that point the IP address changed, but the content server is running correctly on the new address.

Removing the distro version and re-installing 3.26.1 fixes this, but then I always get the GTK style errors on startup :-(

Any ideas? Is there packaging info I can pass on the the OpenSUSE maintainers to correct this?

Thanks!

Dan

Last edited by drawson1; 06-19-2018 at 11:06 AM.
drawson1 is offline   Reply With Quote