From 2ad885b726cc6950de3aea2d74e6e04ca0b76cdd Mon Sep 17 00:00:00 2001 From: Giulio Gratta Date: Thu, 3 Aug 2017 10:19:39 -0700 Subject: [PATCH] Fix attrib check code for library_content import Attributes come in as a list of dicts with strings as keys and values. Implicitly casting each result as a tuple causes the code to split the key string into it's characters. This yields a list of characters, the first two of which are placed into the variables "attr_name" and "attr_value". This is not only wrong, but because keys tend to be more than 2 characters, the net result is: "ValueError: too many values to unpack" --- common/lib/xmodule/xmodule/library_content_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/library_content_module.py b/common/lib/xmodule/xmodule/library_content_module.py index 7e52ba15f5..f11033e1a7 100644 --- a/common/lib/xmodule/xmodule/library_content_module.py +++ b/common/lib/xmodule/xmodule/library_content_module.py @@ -624,7 +624,7 @@ class LibraryContentDescriptor(LibraryContentFields, MakoModuleDescriptor, XmlDe ] definition = { attr_name: json.loads(attr_value) - for attr_name, attr_value in xml_object.attrib + for attr_name, attr_value in xml_object.attrib.items() } return definition, children