alpernebbi / git-annex-metadata-gui

Graphical interface for git-annex metadata commands
GNU General Public License v3.0
59 stars 4 forks source link

GUI crashes when selecting file #2

Closed pigmonkey closed 7 years ago

pigmonkey commented 7 years ago

As mentioned in #1, I can load the GUI in one of my annexes, but it crashes as soon as I select a file.

$ git-annex-metadata-gui ~/library/tracks
Traceback (most recent call last):
  File "/home/pigmonkey/.virtualenvs/annexgui/lib/python3.5/site-packages/git_annex_metadata_gui/gui.py", line 223, inselection_updated
    self.docks.editor.set_item(item)
  File "/home/pigmonkey/.virtualenvs/annexgui/lib/python3.5/site-packages/git_annex_metadata_gui/docks.py", line 145, in set_item
    for field in item:
  File "/home/pigmonkey/.virtualenvs/annexgui/lib/python3.5/site-packages/git_annex_adapter.py", line 341, in __iter__
    for field in self.fields().keys():
  File "/home/pigmonkey/.virtualenvs/annexgui/lib/python3.5/site-packages/git_annex_adapter.py", line 294, in fields
    new_fields = self.query(fields=fields).get('fields', {})
  File "/home/pigmonkey/.virtualenvs/annexgui/lib/python3.5/site-packages/git_annex_adapter.py", line 413, in __call__
    return response if query_line else json.loads(response)
  File "/usr/lib64/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[1]    5572 abort (core dumped)  git-annex-metadata-gui ~/library/tracks

One of the files which causes a crash is README.md. The file looks fine.

$ key=$(git-annex lookupkey README.md)
$ git-annex metadata --key $key --json
{"command":"metadata","key":"SHA256E-s1183--4393779507d284eb5834b113488bb9ffae80bd773eb324d5e9b2bcc24e2d585d.md","lastchanged":["2015-08-22@19-03-01"],"month":["8"],"month-lastchanged":["2015-08-22@19-03-01"],"year":["2015"],"year-lastchanged":["2015-08-22@19-03-01"],"note":"lastchanged=2015-08-22@19-03-01\nmonth=8\nmonth-lastchanged=2015-08-22@19-03-01\nyear=2015\nyear-lastchanged=2015-08-22@19-03-01\n","success":true}

However, you asked me to run some commands with --batch. My metadata doesn't take --batch.

$ git-annex metadata --batch
Invalid option `--batch`
$ git-annex version
git-annex version: 6.20160613-g1e4e6f4
build flags: Assistant Webapp Pairing Testsuite S3(multipartupload)(storageclasses) WebDAV Inotify DBus DesktopNotify XMPP ConcurrentOutput TorrentParser MagicMime Feeds Quvi
key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 SHA1E SHA1 MD5E MD5 WORM URL
remote types: git gcrypt S3 bup directory rsync web bittorrent webdav tahoe glacier ddar hook external
local repository version: 5
supported repository versions: 5 6
upgrade supported from repository versions: 0 1 2 3 4 5
operating system: linux x86_64

That may be the problem. It looks like the Arch package that I use is out of date for some reason.

alpernebbi commented 7 years ago

Right now I rely on the git-annex metadata --batch --json which was introduced in 6.20160727.

Like #1, tracked at alpernebbi/git-annex-adapter#1.

pigmonkey commented 7 years ago

This is resolved now that Arch is on 6.20161118.