jayvdb created this task.
jayvdb claimed this task.
jayvdb added a subscriber: jayvdb.
jayvdb added a project: pywikibot-core.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  The User class is a subclass of Page offering special methods relevant to a 
MediaWiki user as well as the page for the User.
  
  It also has functionality to represent an autoblock ID, likely solely because 
{T19781}.  The log entry API returns titles of 'User:#<autoblockid>' for 
English sites and 'Benutzer:#<autoblockid>' for German sites.
  
  As `User:#<autoblockid>` is an invalid MediaWiki page title, the User class 
detects a 'page' title of '#<autoblockid>' , removes the `#` and so creates a 
User with title 'User:<auoblockid>'.
  
  While `User(site, '#<autoblockid>')`works, it does not support `User(site, 
'User:#<autoblockid>')` or `User(site, 'Benutzer:#<autoblockid>')`.  Including 
a namespace results in an exception:
  
  ```
    File "pywikibot/page.py", line 2718, in __init__
      if self.namespace() != 2:
    File "pywikibot/page.py", line 173, in namespace
      return self._link.namespace
    File "pywikibot/page.py", line 4896, in namespace
      self.parse()
    File "pywikibot/page.py", line 4824, in parse
      u"'{0}' has no title.".format(self._text))
  InvalidTitle: 'User:#1338201' has no title.
  ```
  
  An autoblock ID is also nothing like a MediaWiki user.  The only user feature 
that can be used with an autoblockid is unblock (even reblock is not possible). 
 However the User class does not offer an unblock method, so every method of 
User and inherited Page is invalid for an autoblock ID.  The only method that 
understands that '#' was stripped from the 'title' is `User.username`.   
Several other User methods raise exception `AutoblockUser` when used with an 
autoblock ID.  However not all User methods do this, and inherited methods do 
not.  In the case of inherited User.title(), it will return the incorrect title 
- the title of a different MediaWiki user.

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

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

To: jayvdb
Cc: Aklapper, pywikibot-bugs-list, jayvdb, Malyacko



_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to