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

bug with the --delete flag #3

Open
Proulx-S opened this issue Sep 11, 2022 · 2 comments
Open

bug with the --delete flag #3

Proulx-S opened this issue Sep 11, 2022 · 2 comments

Comments

@Proulx-S
Copy link

Thanks for the great contribution.

An error seems to be returned as soon as a to-be-deleted file is encountered. Everything runs fine so far without the --delete flag.

I am run MacOS 12.2.1 and Python 3.8.2 and here is the error message:

[Deleting   ] ' Time 2022-09-11T04:00:50Z Rouder et al_2009_Bayesian t tests for accepting and rejecting the null hypothesis'
Traceback (most recent call last):
  File "sync.py", line 75, in <module>
    process_files(delete=args.delete, download=args.download)
  File "sync.py", line 73, in process_files
    delete_file(file)
  File "sync.py", line 45, in delete_file
    rmapi(f'rm "{path}"')
  File "sync.py", line 23, in rmapi
    return subprocess.check_output(f"{RMAPI_BIN} {cmd}", shell=True, stderr=subprocess.STDOUT).decode("utf-8").split('\n')[0:-1]
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'rmapi rm "zotero/ Time 2022-09-11T04:00:50Z Rouder et al_2009_Bayesian t tests for accepting and rejecting the null hypothesis"' returned non-zero exit status 1.
@sebastianpech
Copy link
Owner

Hi. I can't maintain the project at the moment. Nevertheless, just from reading the error message, the printed path looks a bit odd. Try running the failing command rm "zotero/ Time 2022-09-11T04:00:50Z Rouder et al_2009_Bayesian t tests for accepting and rejecting the null hypothesis directly in rmapi to see the detailed error message

@Proulx-S
Copy link
Author

I investigated this a little more and it seems that the argument that the rm command (within rmapi) gets is the last argument of sync.py followed by what seems to be one of the lines that rmapi displays when it is "Refreshing thee..."

takoyaki[1]:Zotero-Remarkable$ python3 sync.py --delete ~/Zotero/remarkable /zotero
[Uploading  ] 'drew_2020_ultra-slow_oscillations_in_fmri_and_resting-state_connectivity'
[Uploading  ] 'das_2021_rude_mechanicals_in_brain_haemodynamics'
[Deleting   ] ' Time 2022-09-12T05:08:03Z Quick sheets'
Traceback (most recent call last):
  File "sync.py", line 75, in <module>
    process_files(delete=args.delete, download=args.download)
  File "sync.py", line 73, in process_files
    delete_file(file)
  File "sync.py", line 45, in delete_file
    rmapi(f'rm "{path}"')
  File "sync.py", line 23, in rmapi
    return subprocess.check_output(f"{RMAPI_BIN} {cmd}", shell=True, stderr=subprocess.STDOUT).decode("utf-8").split('\n')[0:-1]
  File "/usr/lib64/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib64/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'rmapi rm "/zotero/ Time 2022-09-12T05:08:03Z Quick sheets"' returned non-zero exit status 1.
takoyaki[1]:Zotero-Remarkable$ rmapi
Refreshing tree...
 Time 2022-09-12T05:08:03Z Quick sheets
 Time 2022-09-21T17:03:02Z Test
 Time 2022-09-21T19:26:26Z das_2021_rude_mechanicals_in_brain_haemodynamics
 Time 2022-09-21T17:02:50Z Notebook
 Time 2022-09-20T16:12:53Z 20220920--polimeniGroup
 Time 2022-09-21T19:26:23Z drew_2020_ultra-slow_oscillations_in_fmri_and_resting-state_connectivity
 Time 2022-09-13T17:03:20Z 20220913--polimeniGroup
 Time 2022-09-21T17:02:20Z zotero
 Time 2022-09-20T16:12:16Z 20220915--sig
 Time 2022-09-14T13:00:24Z 20220914--MRIsafetyTraining
 Time 2022-09-12T18:58:12Z Meetings
 Time 2022-09-12T19:03:40Z 20220912--U19siteVisit
 Time 2022-09-21T17:02:34Z zotero
WARNING!!!
  Using the new 1.5 sync, this has not been fully tested yet!!!
  Make sure you have a backup, in case there is a bug that could cause data loss!
ReMarkable Cloud API Shell

I presume the delete flags is not correctly handling these time fields...

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

2 participants