Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac python 2, able to query but not read or edit-note #39

Open
kevintaylor opened this issue Dec 3, 2017 · 4 comments
Open

Mac python 2, able to query but not read or edit-note #39

kevintaylor opened this issue Dec 3, 2017 · 4 comments

Comments

@kevintaylor
Copy link

New user. Mac Sierra. Python
$ python --version
Python 2.7.10

Am able to query my zotero db. E.G.

$ zotcli query Sullivan
[REFTHQBY] Sullivan and Miller: Segmenting the informal venture capital market: Economic, hedonistic, and altruistic investors (May 1996)

When reading or edit-noting, it chokes.

$ zotcli read sullivan
Traceback (most recent call last):
File "/usr/local/bin/zotcli", line 9, in
load_entry_point('zotero-cli==0.3.0', 'console_scripts', 'zotcli')()
File "/Library/Python/2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/Library/Python/2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Library/Python/2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Python/2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Python/2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Python/2.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Library/Python/2.7/site-packages/zotero_cli/cli.py", line 208, in read
att_path = ctx.obj.get_attachment_path(read_att)
File "/Library/Python/2.7/site-packages/zotero_cli/backend.py", line 239, in get_attachment_path
"Attachment is not stored on server, cannot download!")
ValueError: Attachment is not stored on server, cannot download!

$ zotcli read REFTHQBY
Traceback (most recent call last):
File "/usr/local/bin/zotcli", line 9, in
load_entry_point('zotero-cli==0.3.0', 'console_scripts', 'zotcli')()
File "/Library/Python/2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/Library/Python/2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Library/Python/2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Python/2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Python/2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Python/2.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Library/Python/2.7/site-packages/zotero_cli/cli.py", line 198, in read
attachments = ctx.obj.attachments(item_id)
File "/Library/Python/2.7/site-packages/zotero_cli/backend.py", line 224, in attachments
attachments = self._zot.children(item_id, itemType="attachment")
File "/Library/Python/2.7/site-packages/pyzotero/zotero.py", line 129, in wrapped_f
retrieved = self._retrieve_data(func(self, *args))
File "/Library/Python/2.7/site-packages/pyzotero/zotero.py", line 608, in children
i=item.upper())
AttributeError: 'NoneType' object has no attribute 'upper'

@kevintaylor
Copy link
Author

After using zotcli for a bit I realize this is caused by trying to add-note or edit-note to a library item that already has a note that was not created by zotcli.

My suggestion is to handle errors from this and let the user know they need to remove the non-zotcli note. Or, better, convert non-zotcli notes into markdown zotcli notes so they are editable.

@cbcoutinho
Copy link

cbcoutinho commented Mar 1, 2018

I'm having the same issue as you, specifically with zotcli having trouble with the 'NoneType' object has no attribute 'upper' error. I am unable to edit existing Zotero notes, which is understandable, but I'm also unable to edit notes I have created only using zotcli - that's pretty strange.

Further, notes I create using zotcli are placed in my 'Unfiled Items' catergory rather than under the item I originally intended.

NOTE: This was with python3 instead of python2

@lf-araujo
Copy link

Can confirm same error as @cbcoutinho under archlinux, python3.

@pszenher
Copy link

Receiving the same error as @cbcoutinho and @lf-araujo under Ubuntu with python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants