Mike_Peel created this task.
Mike_Peel added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  In past versions of pywikibot I was able to do this:
  
    import pywikibot
    
    enwp = pywikibot.Site('en', 'wikipedia')
    repo = enwp.data_repository()
    
    enwp_page = pywikibot.Page(enwp, 'South Pole Telescope')
    content = enwp_page.get()
    wd_item = pywikibot.ItemPage.fromPage(enwp_page)
    item_dict = wd_item.get()
    print(item_dict['sitelinks']['commonswiki'].replace('South','Test'))
  
  which would return
  
    Category:Test Pole Telescope
  
  With the current version of pywikibot, however, I get this:
  
    Traceback (most recent call last):
      File "test.py", line 10, in <module>
        print(item_dict['sitelinks']['commonswiki'].replace('South','Test'))
    AttributeError: 'SiteLink' object has no attribute 'replace'
  
  Something has clearly changed, is this documented somewhere, and is there a 
new method to get the string of the sitelinks, please?

TASK DETAIL
  https://phabricator.wikimedia.org/T265800

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Mike_Peel
Cc: Aklapper, pywikibot-bugs-list, Mike_Peel, JohnsonLee01, SHEKH, Dijkstra, 
Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, 
Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to