Comments (10)
Which operating system are you using? I suspected you were using Windows and tested the script in a Win 8.1 VM, but I didn't encounter this error.
Can you please open your terminal or command line, open a python3 interpreter and type in
import sys
sys.getdefaultencoding()
and tell me what the output is?
You may also try replacing the above mentioned line with
print(u'\n'.join(tree))
from acd_cli.
The defaultencoding gives me utf-8. I'v tried this on 2 Ubuntu 14.04s and it happens on both. And I've also changed the line with the one you suggested, but no difference.
I've also tried on OSX, which gives me a different error (this one happens when running sync command):
Traceback (most recent call last):
File "./acd_cli.py", line 216, in <module>
main()
File "./acd_cli.py", line 110, in main
sync_node_list()
File "./acd_cli.py", line 28, in sync_node_list
sync.insert_files(files)
File "/Users/jure/acd_cli/cache/sync.py", line 107, in insert_files
for db_file in db.session.query(db.File):
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2440, in __iter__
self.session._autoflush()
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 1264, in _autoflush
self.flush()
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 1985, in flush
self._flush(objects)
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 2103, in _flush
transaction.rollback(_capture_exception=True)
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 182, in reraise
raise value
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 2067, in _flush
flush_context.execute()
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
rec.execute(self)
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 526, in execute
uow
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/persistence.py", line 46, in save_obj
uowtransaction)
File "/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/persistence.py", line 171, in _organize_states_for_save
state_str(existing)))
sqlalchemy.orm.exc.FlushError: New instance <File at 0x110eba358> with identity key (<class 'cache.db.Node'>, ('NklHY0bAT2-w3I98bgMYXg',)) conflicts with persistent instance <File at 0x110ebae48>
This one updates the folders, but not the files.
I didn't try on windows yet, I can do it tomorrow.
from acd_cli.
I will try to reproduce the error on Ubuntu 14.04 later.
The syncing problem when updating nodes might be gone with the new version that I just pushed. If not, you can use the clear-cache
action to fully clear the cache prior to syncing to eliminate this.
from acd_cli.
Ok, I can confirm, that the error is fixed on OSX, but it still happens on Ubuntu.
from acd_cli.
Unfortunately, I was not able to reproduce this behaviour with an Ubuntu 14.04 live CD.
Could you please replace the tree_action
method in acd_cli.py
, run it again and post the log
def tree_action(args):
import traceback
tree = selection.node_list(trash=args.include_trash)
for node in tree:
try:
print(node)
except UnicodeError:
print(traceback.format_exc())
You might additionally want to have a look at the output of
python3 -c "import json; from acd import oauth, metadata; oauth.get_data(); from pprint import pprint; pprint(metadata.get_node_list())" | grep name
and
echo "from cache import db\nnodes = db.session.query(db.Node).all()\nfor node in nodes:\n print(node)" | python3
and maybe also inspect the node names in the sqlite file nodes.db
with sqlitebrowser.
from acd_cli.
Yeah, I was starting to suspect this. The errors occur in folders which have the following letters in the filename: ČŠŽčšž
Other than that, it works fine now.
from acd_cli.
Different problem on raspberrypi (latest Raspbian). When I do the Oauth stuff and paste the url I got from Amazon I get this:
Traceback (most recent call last):
File "./acd_cli.py", line 416, in <module>
main()
File "./acd_cli.py", line 393, in main
oauth.get_data()
File "/home/ssitcm/acd_cli/acd/oauth.py", line 71, in get_data
conn_data['token'] = authenticate()
File "/home/ssitcm/acd_cli/acd/oauth.py", line 102, in authenticate
r = response.json()
TypeError: 'dict' object is not callable
Really sorry for all my problems that I'm bugging you with (I'm a QA :)) and thanks for all the great work!
from acd_cli.
It seems your python-3 requests is outdated on your Raspberry Pi. Try to update to a newer version using pip (should be pip-3.2
on Raspbian). The requests library is used for virtually all Amazon API calls.
PS: There is nothing wrong with posting bug reports; but please open another issue next time, because this is not related to the Unicode problem.
from acd_cli.
Thanks yadada : I had the same issue (python3-requests outdated on wheezy).
A pip update solved the problem.
from acd_cli.
I get the same error on some machines. Not on all. (Only tried winXP and win7)
adding:
import codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
to acd_cli.py solved the problem for me.
from acd_cli.
Related Issues (20)
- 403 on https://acd-cli-oa-backup.appspot.com/ and https://tensile-runway-92512.appspot.com/ HOT 3
- rsync fails HOT 1
- Can't seem to be successful in authorising acd_cli again HOT 29
- Error getting account quota data. HOT 2
- Refreshing authentication token - Unauthorized HOT 2
- acd_cli does not link to the new authorisation site HOT 9
- I have error: RequestError: 1004, Error refreshing authentication token HOT 9
- RequestError: 400 {"message":"Cannot complete upload"} & RequestError: 400 {"message":"Cannot read from request."} HOT 13
- [ERROR] [acd_cli] - Root node not found. Sync may have been incomplete. HOT 13
- SSL: CERTIFICATE_VERIFY_FAILED HOT 2
- Folder "{ID}" already exists HOT 3
- Difficulties for initial configuration of Acd_cli HOT 2
- How to purge dangling parents? HOT 2
- Rate Exceeded HOT 82
- No Body Received HOT 5
- Amazon is removing unlimited plan HOT 7
- 404 after acd_cli init HOT 2
- 404 when running acd_cli init (or sync or mount) with 'simple' authentication HOT 8
- AndroidTV support
- is this project dead ? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acd_cli.