-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
AttributeError: 'str' object has no attribute 'append' #78
Comments
On another note, if I hover over the icon on the task bar it looks like a lot of items are being upload. However:
The message makes me worry about some unintended mass upload but so far this doesn't seem to be happening. |
This is a very unusual configuration and I am not sure I fully understand it. Do you give the full path or the symlinked path to Maestral? In the second case, there may be some issues with tracking file changes. The error which you are seeing is caused by the config file. It keeps a list of the 30 most recently changed files, for display in the GUI. However, when reading this list Could you check the following?
[internal]
cursor = AAFi1HsN7eusTjZbKn7Q5lmyRv_t9DHLkJAfCOQUpdPc_B3MqLMZ-2u39QggJeF7IxWApmq4qqYs0QvwYQUxbrFAGe0q4ZFRYNYbDlBFB2BhIoPxEeiedgabY8QG74rS07557SHSq06Xud60pRoayjTj3II8mu4Msv1yJZRdz7Kp4CAzbAYOYJafDr9bckOyYvEuAXcQaDg9FXT6LBeqWBmv1GVz2wuC5rI-bJhex0J7GkQKVTix6Sr59WkS4REaBAWnkKi-b6WXZpyUoAtmuI8ufF5KqJMQjVW6cJong9JnE9BqDdyQCg9UrJ2qGIVr5HSbrPOiW9vZEnWIXctUg-D1OmDhGc-KeGSFmQfHMyn0rXUqy7JUiAuGg1VD9nsDgK7UwffzIIP68zWfVJf9MCFI-NBNPKsohzcuWdmZ2Se6T-Xuc0NzGkuU6JJEiRZnr4F5FG6BkztCgv08tX-OKGir9FkTuR53rlLinTNsYzmwMTq4F4qtDd2lqW8BgWbMUHlBTjlsi_G5Q1RnZHv5kJSYOzLPbXomAoW29pVHUcjkSjoi-eBwiai1LeTorUV8dmQqbCG6oUzo3TqYX4AubHe-9uQm5UjMGZczr6xc61bXURxzvXxR-k-t9LsCRmic80MLTvfKM6z1YO8CRsUh8F-N
lastsync = 1578074677
recent_changes = ['path1', 'path2', 'path3', ...] |
It looks like the string is getting truncated. I'm guessing that my paths are longer than you expected. Maybe, some code needs to be implemented to change how many entries to include in recent changes if a valid list isn't returned.
Notice that there is no closing single quote or right bracket. |
I sent you the following dropbox invite so that you can view the folder:
|
I'm not sure exactly how the dropbox api works but I know that for some parses, you can't get a parsed result until you read enough data. I see the following in your code:
I see that other people are first checking the datatype before appending:
https://stackoverflow.com/a/54818092 Perhaps the maestral code needs to do a similar check, to make sure the dropbox parser has read enough data to parse the whole path. I only started looking at the code tonight and have never used the dropbox api before so this is just a guess. |
I just edited the ".ini" file so that the last "erroneously named path" on the list of recently changed files was removed, and I added the closing bracket So that it looked like,
So far it seems to be working. I'll let you know if I get said error again. Perhaps, the code could do the same if the following line: Doesn't return a valid list then the code could try the same (i.e. strip the last comma and all subsequent text and then add the closing bracket. There is a raw option in config.get() but my guess is that even without the raw option the config.get() method will returns a string anyway if it can't parse a valid list and consequently the raw option probably isn't necessary. Finally if all else fails, we just set this config value for recently changed files to the defaut (i.e. []). My guess about what happened is something interrupted maestral during the processes of writing the ini. Consequently, the check that I suggested in the previous post might not be necessary. |
Thanks for following up on this!
This should not be necessary, the Dropbox Python SDK already checks the results returned from the dropbox api. The referenced stack overflow code only checks if the returned entries are instances of
Agreed. I tried to reproduce this by joining your shared folder (many thanks!) but could sync it without issues. This doesn't seem to be an issue with the length of the path but could be related to thread safety. The config file is accessed from multiple threads. The config code is one of the few pieces which I did not write myself but took from the spyder project. It is built around Python's ConfigParser. I will look into it... |
I have been looking through the config code and merging changes from the upstream spyder project. The actual config file is read only on startup, subsequent changes are written to the file but cached and read from memory. Therefore, even if writing a new value fails, the value in memory should still be a valid list. This is of course not true between restarts: if the last write has failed for some reason, an incorrect value will be loaded. I have now added a lock to prevent concurrent writes from the same process, I hope this fixes the issue. |
Closing as this seems fixed. Feel free to reopen if the issue reoccurs. |
I'm trying to run Maestral on fatdog64, the folder ~/"Dropbox (Maestral)" is symlinked from a ext4 save file (in a aufs layered file system), to a folder on a NTFS partition. The syncing was working for a fair bit then I got the unexpected error.
When I closed the dialog the syncing than resumed.
The text was updated successfully, but these errors were encountered: