rienafairefr / pynYNAB

a python client for the new YNAB
MIT License
138 stars 12 forks source link

csvimport fails on python 3 #7

Closed abesto closed 8 years ago

abesto commented 8 years ago

With the following output. Works fine on python 2.

[03/15/2016 15:25:47] DEBUG:pynYNAB:POST-ing ... {'operation_name': 'syncCatalogData', 'request_data': '{"device_knowledge_of_server": 64029849, "changed_entities": {}, "starting_device_knowledge": 0, "ending_device_knowledge": 0}'}
[03/15/2016 15:25:47] pynYNAB CSV import
[03/15/2016 15:25:47] Traceback (most recent call last):
[03/15/2016 15:25:47] File "/Users/abesto/playground/nYNABapi/pynYNAB/scripts/csvimport.py", line 165, in <module>
[03/15/2016 15:25:47] csvimport_main()
[03/15/2016 15:25:47] File "/Users/abesto/playground/nYNABapi/pynYNAB/scripts/csvimport.py", line 40, in csvimport_main
[03/15/2016 15:25:47] do_csvimport(args)
[03/15/2016 15:25:47] File "/Users/abesto/playground/nYNABapi/pynYNAB/scripts/csvimport.py", line 162, in do_csvimport
[03/15/2016 15:25:47] client.add_transactions(transactions)
[03/15/2016 15:25:47] File "/Users/abesto/playground/nYNABapi/pynYNAB/Client.py", line 117, in add_transactions
[03/15/2016 15:25:47] self._add_transactions(chunkelement)
[03/15/2016 15:25:47] File "/Users/abesto/playground/nYNABapi/pynYNAB/Client.py", line 71, in wrapped
[03/15/2016 15:25:47] self.sync()
[03/15/2016 15:25:47] File "/Users/abesto/playground/nYNABapi/pynYNAB/Client.py", line 65, in sync
[03/15/2016 15:25:47] self.budget.sync(self.connection, 'syncBudgetData')
[03/15/2016 15:25:47] File "/Users/abesto/playground/nYNABapi/pynYNAB/roots.py", line 25, in sync
[03/15/2016 15:25:47] change, request_data = self.get_request_data()
[03/15/2016 15:25:48] File "/Users/abesto/playground/nYNABapi/pynYNAB/roots.py", line 87, in get_request_data
[03/15/2016 15:25:48] k, request_data = super(Budget, self).get_request_data()
[03/15/2016 15:25:48] File "/Users/abesto/playground/nYNABapi/pynYNAB/roots.py", line 50, in get_request_data
[03/15/2016 15:25:48] changed_entities = self.get_changed_entities()
[03/15/2016 15:25:48] File "/Users/abesto/playground/nYNABapi/pynYNAB/roots.py", line 106, in get_changed_entities
[03/15/2016 15:25:48] be_subtransactions=subtransactions
[03/15/2016 15:25:48] File "/Users/abesto/playground/nYNABapi/pynYNAB/Entity.py", line 224, in append
[03/15/2016 15:25:48] self._dict_entities_hash[o.hash()] = o
[03/15/2016 15:25:48] File "/Users/abesto/playground/nYNABapi/pynYNAB/Entity.py", line 125, in hash
[03/15/2016 15:25:48] return hash(frozenset({k: v for k, v in self.getdict().items() if k not in ignored_fields_for_hash}.items()))
[03/15/2016 15:25:48] TypeError: unhashable type: 'Transaction'
rienafairefr commented 8 years ago

Yep, there as a bug with hash, get the new source, I think solved in commit d948cc32dca35db22a72c841ec63c07bd2102c25

abesto commented 8 years ago

Confirming, it's fixed in HEAD. Thanks.