https://bugzilla.wikimedia.org/show_bug.cgi?id=73151
Bug ID: 73151 Summary: Site object becomes a string MySQLPageGenerator, throws error Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: pagegenerators Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: gpaumier@wikimedia.org Web browser: --- Mobile Platform: ---
MySQLPageGenerator says it can take a 'site' argument as either a Site object or a string (that represents the dbname). If 'site' isn't given, it defaults to the current Site.
In all cases, site ends up being a string, either because that's what was passed as an argument, or because the Site object is replaced by the dbname in 'site = site.dbName()'
However, a few lines later, site is expected to be a Site object again in 'query = query.encode(site.encoding())'.
This throws an AttributeError: 'unicode' object has no attribute 'encoding'.