-
Notifications
You must be signed in to change notification settings - Fork 36
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
mergeparameters AttributeError: 'dict' object has no attribute 'move_to_end' #53
Comments
I just experienced the same problem. Two years ago when I last used the tool there was no such a problem. Maybe there is a problem with new python versions? |
Just hit this issue myself, it is due to backwards compatible change in xmltodict v0.13 (xmltodict is dsptoolkit dependency) Fix is simple: xmltodict.parse() needs additional parameter dict_constructor=OrderedDict. In self.doc = xmltodict.parse(fd.read(), dict_constructor=OrderedDict) |
Thanks for the reply. But where is the file when installed on my Raspberry Pi? |
You can see it in the error message Traceback (most recent call last): |
xmltodict v0.13 started using dict (instead of previous default OrderedDict) when parsing xml with python < 3.7. See martinblech/xmltodict@231b4d4 This restores the previous behaviour, using OrderedDict, making the behaviour compatible with dsptoolkit. The change should be backwards compatible with older versions of xmltodict, as dict_constructor parameter has been there for quite some time. Signed-off-by: Sami Salonen <[email protected]>
PR submitted in #54 |
Hello,
I am trying to use the merge tool for metadata, but i receive the following errors:
'''
pi@raspberrypi:~/phat $ mergeparameters dsc_phat.xml dsc_phat.params
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/hifiberrydsp/parser/xmlprofile.py", line 253, in update_metadata
beometa = self.doc["ROM"]["beometa"]
KeyError: 'beometa'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/mergeparameters", line 28, in
merge_params_main()
File "/usr/local/lib/python3.9/dist-packages/hifiberrydsp/parser/sigmaparams.py", line 236, in merge_params_main
params = pf.merge_params_into_xml(xmlfile)
File "/usr/local/lib/python3.9/dist-packages/hifiberrydsp/parser/sigmaparams.py", line 190, in merge_params_into_xml
xml.update_metadata(param_list)
File "/usr/local/lib/python3.9/dist-packages/hifiberrydsp/parser/xmlprofile.py", line 257, in update_metadata
self.doc["ROM"].move_to_end('beometa', last=False)
AttributeError: 'dict' object has no attribute 'move_to_end'
'''
Running python3.9 and and latest dsptoolkit from pip
The text was updated successfully, but these errors were encountered: