Giter Site home page Giter Site logo

"tuple index out of range" about zowie HOT 9 CLOSED

mhucka avatar mhucka commented on September 28, 2024
"tuple index out of range"

from zowie.

Comments (9)

lutefiasco avatar lutefiasco commented on September 28, 2024

I'm sure this is on me,

I managed to get the debug output, though the error still occurs.
relevant bits:

saving credentials to keyring
keyring_utils.py:71 save_keyring_credentials() -- storing "DELETED" to keyring mhucka.zowie
zotero.py:91 init() -- connecting to Zotero as user DELETED
main_body.py:78 run() -- exception in main body: tuple index out of range
main_body.py:80 run() -- finished MainBody
main.py:272 main() -- main body raised exception: (<class 'IndexError'>, IndexError('tuple index out of range'), <traceback object at 0x10af63908>)
cli.py:99 _print_or_queue() -- Encountered error IndexError: tuple index out of range
Encountered error IndexError: tuple index out of range
main.py:288 main() -- Exception: tuple index out of range
Traceback (most recent call last):
File "/Users/DELETED/.pyenv/versions/3.7.3/lib/python3.7/site-packages/zowie/main_body.py", line 75, in run
self._do_preflight()
File "/Users/DELETED/.pyenv/versions/3.7.3/lib/python3.7/site-packages/zowie/main_body.py", line 130, in _do_preflight
if len(self.files) > 1 or path.isdir(self.files[0]):
IndexError: tuple index out of range

from zowie.

mhucka avatar mhucka commented on September 28, 2024

Thanks for the report! I see the reason for the error (it's a bug -- it's not testing for a empty self.files before trying to index into it), but from the discussion on the DEVONthink forums, it sounds like the location you are trying to use is empty, which will still be a problem even after this bug is fixed. Can you tell me more about your Zotero setup? Specifically, where do the PDF files for your library live? See the Preferences, under Advanced, "Files and Folders", like the screenshot here – it would help me to know the data directory location in your setup:

image

from zowie.

lutefiasco avatar lutefiasco commented on September 28, 2024

Well, it's good to know it isn't just me.

All the PDFs for my Zotero library are synced across all my devices by Box.com (provided by UCLA, where I'm faculty), which appears and functions as a regular folder in the MacOS Finder. (If anything, it avoids some of the annoying issues with iCloud requiring under-used files redownload). So, my Zotero library is in the default location, but every PDF is a "linked" attachment, and distributed across perhaps a dozen subfolders below ~/Box Sync/. So, that's the Zotero base directory. The data directory is in the default location.
Screen Shot 2021-01-11 at 7 25 00 PM

Anyway, thanks for looking into the bug / issue. DevonThink is made even more amazing by having such an interested and interesting development community.

from zowie.

mhucka avatar mhucka commented on September 28, 2024

The bug caused Zowie to not complain about a missing argument. I'm fixing that now and will produce a version 1.1.1. Once that's fixed, can you try it again with something like the following?

zowie ~/Box\ Sync

or if you only want it to act on PDF files,

zowie -f pdf ~/Box\ Sync

(note the backslash for quoting of the space in the pathname). Unfortunately I've never used this "linked attachment" scheme so I don't even know what the structure looks like inside that directory. If it's full of symbolic links, we may find out it won't work without additional changes. But let's fix this argument parsing problem first.

from zowie.

mhucka avatar mhucka commented on September 28, 2024

OK, version 1.1.1 is out there, if you want to give it a try. (Whenever – no rush.)

from zowie.

lutefiasco avatar lutefiasco commented on September 28, 2024

Screen Shot 2021-01-12 at 7 50 59 AM

Well, the upgrade worked. The folder is just full of real PDFs, not symbolic links, but clearly the relationship between the PDFs and the Zotero database works differently. It's possibly my use-case is fairly rare. Thanks for the fix, though.

from zowie.

mhucka avatar mhucka commented on September 28, 2024

Shoot, that's too bad. The way Zowie figures out the record associated with a given PDF file is that in the other Zotero storage option, the files are in subdirectories keyed by a unique identifier, like ..../Z743PE2/some filename.pdf. Thanks to that, it's possible to ask the Zotero API about Z743PE2. Without that, I don't know how to infer the record associated with a given file.

from zowie.

mhucka avatar mhucka commented on September 28, 2024

I'll ask on the Zotero forums. Maybe there's a way to do it.

In the meantime, I'm going to close this issue, as it appears the original reason (the error that arose when no argument was given) has been resolved.

Update: the Zotero forum question is at https://forums.zotero.org/discussion/comment/372519/#Comment_372519

from zowie.

mhucka avatar mhucka commented on September 28, 2024

Fixed in release 1.1.1.

from zowie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.