Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
xmltodict 0.13.0 dropped OrderedDict as the default dict constructor for python>=3.7: martinblech/xmltodict@v0.12.0...v0.13.0. python3.7 dicts are by specification, ordered. This breaks line 453 of sraweb.py, which tests isinstance of OrderedDict. To fix this, we can pass an explicit argument
dict_constructor=OrderedDict
toxmltodict.parse
.Error reproduction (without the fix):
Env:
python 3.7.6 (or python 3.8.10)
Other discussions:
The way xmltodict breaks backward compatibility and the way we specify 'xmltodict>=0.12.0' both contributed to this unexpected error. We may want to fix the minor version of xmltodict and only allow auto-upgrade of patch version: e.g. 'xmltodict~=0.13.0'.
Of course, the other way to fix this is to drop OrderedDict in pysradb for ordinary dict. More lines would be involved. I would opt to do that in a refactor PR.