Skip to content
This repository has been archived by the owner on Nov 25, 2019. It is now read-only.

MediaWiki metadata does not always contain rights #38

Closed
GreenReaper opened this issue Sep 26, 2014 · 1 comment
Closed

MediaWiki metadata does not always contain rights #38

GreenReaper opened this issue Sep 26, 2014 · 1 comment

Comments

@GreenReaper
Copy link

wiki.py assumes that the 'rights' attribute exists in the general siteinfo. It seems that it was previously blank if not set, however this is no longer the case, at least as of 1.23 and perhaps earlier.

        if options.license:
            license_file = options.license
        else:
            rights = general_siteinfo['rights']
            if rights in known_licenses:
                license_file = known_licenses[rights]
            else:
                license_file = None
                self.metadata['license'] = rights

aardc fails with "KeyError: 'rights'" on the general_siteinfo line.

One workaround is to add "--license path/to/text/file" before the "wiki" on the command line.

@itkach itkach closed this as completed Oct 2, 2014
@itkach itkach reopened this Oct 2, 2014
@itkach
Copy link
Member

itkach commented Oct 2, 2014

c86cb5e updates aard-siteinfo to request rightsinfo to be included in siteinfo and 9b1b340, 9b1b340 update wiki.py to look for rightsinfo. That should fix it.

@itkach itkach closed this as completed Oct 2, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants