Page MenuHomePhabricator

AttributeError: can't set attribute on Travis
Closed, ResolvedPublic

Description

    def __setattr__(self, attr, value):
        """Attribute setter. Deprecates lastrevid."""
        if attr == 'lastrevid':
            issue_deprecation_warning(
                'WikibasePage.lastrevid', 'latest_revision_id', 2)
            attr = '_revid'
>       return super(WikibasePage, self).__setattr__(attr, value)
E       AttributeError: can't set attribute

It occurs in multiple places:

  • TestNamespaces.test_wikibase_namespace_selection
  • TestPropertyPage.test_new_claim
  • TestPropertyPage.test_get

see: https://travis-ci.org/wikimedia/pywikibot-core/jobs/197841300

Event Timeline

PropertyPage extends WikibasePage and Property. Change rPWBC5138dd7351c9a7eb21791dcfb3b64e276e6bb445 added labels property to Property class. WikibasePage also had that property. That was the reason for that error.

labels property was needed for T66468. Now I made some changes there to use PropertyPage instead of Property to get labels. So labels property of Property class is not used anymore. That way we can revert rPWBC5138dd7351c9a7eb21791dcfb3b64e276e6bb445 now.

Change 335995 had a related patch set uploaded (by Phantom42):
Fix AttributeError on Travis

https://gerrit.wikimedia.org/r/335995

Change 335995 merged by jenkins-bot:
Fix AttributeError on Travis

https://gerrit.wikimedia.org/r/335995