{"action":"closed","issue":{"url":"https://api.github.com/repos/trickvi/datapackage/issues/68","repository_url":"https://api.github.com/repos/trickvi/datapackage","labels_url":"https://api.github.com/repos/trickvi/datapackage/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/trickvi/datapackage/issues/68/comments","events_url":"https://api.github.com/repos/trickvi/datapackage/issues/68/events","html_url":"https://github.com/trickvi/datapackage/issues/68","id":110434506,"number":68,"title":"TypeError raised when datapackage.json license field is a hash","user":{"login":"flother","id":48392,"avatar_url":"https://avatars.githubusercontent.com/u/48392?v=3","gravatar_id":"","url":"https://api.github.com/users/flother","html_url":"https://github.com/flother","followers_url":"https://api.github.com/users/flother/followers","following_url":"https://api.github.com/users/flother/following{/other_user}","gists_url":"https://api.github.com/users/flother/gists{/gist_id}","starred_url":"https://api.github.com/users/flother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flother/subscriptions","organizations_url":"https://api.github.com/users/flother/orgs","repos_url":"https://api.github.com/users/flother/repos","events_url":"https://api.github.com/users/flother/events{/privacy}","received_events_url":"https://api.github.com/users/flother/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-08T12:06:11Z","updated_at":"2016-05-02T20:56:54Z","closed_at":"2016-05-02T20:56:54Z","body":"The [Data Packages spec states] [1] that the `license` metadata field can be either a hash or a string, but [datapackage only supports it being a string] [2] (also mentioned in the [`DataPackage.license()` method docstring] [3]).\r\n\r\nThis means that when you attempt to load a valid data package that includes a hash in the `license` field, a `TypeError` is raised:\r\n\r\n    >>> import datapackage\r\n    >>> datapackage.DataPackage(\"https://raw.githubusercontent.com/flother/uk-general-election-2015/master/\")\r\n    Traceback (most recent call last):\r\n      File \"<stdin>\", line 1, in <module>\r\n      File \"datapackage/datapackage.py\", line 103, in __init__\r\n        super(DataPackage, self).__init__(**descriptor)\r\n      File \"datapackage/util.py\", line 42, in __init__\r\n        self.__setattr__(key, value)\r\n      File \"datapackage/util.py\", line 80, in __setattr__\r\n        object.__setattr__(self, attribute, value)\r\n      File \"datapackage/datapackage.py\", line 234, in license\r\n        if value not in LICENSES:\r\n    TypeError: unhashable type: 'dict'\r\n\r\nTested using Python 3.4.3 and datapackage 0.5.4.\r\n\r\n[1]: http://dataprotocols.org/data-packages/index.html#strongly-recommended-fields\r\n[2]: https://github.com/trickvi/datapackage/blob/master/datapackage/datapackage.py#L52\r\n[3]: https://github.com/trickvi/datapackage/blob/master/datapackage/datapackage.py#L226-L229\r\n"}}