Page MenuHomePhabricator

Site('test', 'test') is not Site('test', 'wikipedia')
Open, LowPublicBUG REPORT

Description

Looking at:

>>> import pwb, pywikibot as py
>>> s1 = py.Site('test', 'wikipedia')
>>> s2 = py.Site('test', 'test')
WARNING: C:\Python27\lib\importlib\__init__.py:37: DeprecationWarning: test_family is deprecated for 6 days; use wikipedia_family instead.
  __import__(name)

>>> s1, s2
(APISite("test", "wikipedia"), APISite("test", "test"))
>>> s1 == s2
False
>>>

either the comparison should return True or py.Site('test', 'test') should redirect to a site object giving APISite("test", "wikipedia").

Details

Event Timeline

Xqt created this task.Jul 24 2019, 8:48 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptJul 24 2019, 8:48 AM
Xqt triaged this task as Low priority.Jul 24 2019, 8:48 AM
Xqt changed the subtype of this task from "Task" to "Bug Report".
Xqt added a comment.Jul 24 2019, 8:52 AM

Personally I prefer the last idea because we only have one entry in pywikibot._sites dict due to the key of '%s:%s:%s:%s' % (interface.__name__, fam, code, user)

Xqt claimed this task.Fri, Feb 14, 2:57 PM

Change 572250 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] let Site('test', 'test) be equal to Site('test', 'wikipedia')

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