import pywikibot
site = pywikibot.Site()
page = pywikibot.Page(site, u"Hulk")
WARNING: API error mwoauth-invalid-authorization-invalid-user: The authorization headers in your request are for a user that does not exist here
---------------------------------------------------------------------------
NoUsername                                Traceback (most recent call last)
<ipython-input-4-cd47a72f91ee> in <module>()
----> 1 page = pywikibot.Page(site, u"Hulk")

/srv/paws/pwb/pywikibot/tools/__init__.py in wrapper(*__args, **__kw)
   1744                              cls, depth)
   1745                     del __kw[old_arg]
-> 1746             return obj(*__args, **__kw)
   1747 
   1748         if not __debug__:

/srv/paws/pwb/pywikibot/page.py in __init__(self, source, title, ns)
   2263                 raise ValueError(u'Title must be specified and not empty '
   2264                                  'if source is a Site.')
-> 2265         super(Page, self).__init__(source, title, ns)
   2266 
   2267     @property

/srv/paws/pwb/pywikibot/page.py in __init__(self, source, title, ns)
    190 
    191         if isinstance(source, pywikibot.site.BaseSite):
--> 192             self._link = Link(title, source=source, default_namespace=ns)
    193             self._revisions = {}
    194         elif isinstance(source, Page):

/srv/paws/pwb/pywikibot/tools/__init__.py in wrapper(*__args, **__kw)
   1744                              cls, depth)
   1745                     del __kw[old_arg]
-> 1746             return obj(*__args, **__kw)
   1747 
   1748         if not __debug__:

/srv/paws/pwb/pywikibot/page.py in __init__(self, text, source, default_namespace)
   5484         # See bug T104864, default_namespace might have been deleted.
   5485         try:
-> 5486             self._defaultns = self._source.namespaces[default_namespace]
   5487         except KeyError:
   5488             self._defaultns = default_namespace

/srv/paws/pwb/pywikibot/site.py in namespaces(self)
   1020         """Return dict of valid namespaces on this wiki."""
   1021         if not hasattr(self, '_namespaces'):
-> 1022             self._namespaces = NamespacesDict(self._build_namespaces())
   1023         return self._namespaces
   1024 

/srv/paws/pwb/pywikibot/site.py in _build_namespaces(self)
   2635         # For versions lower than 1.14, APISite needs to override
   2636         # the defaults defined in Namespace.
-> 2637         is_mw114 = self.mw_version >= '1.14'
   2638 
   2639         for nsdata in self.siteinfo.get('namespaces', cache=False).values():

/srv/paws/pwb/pywikibot/site.py in mw_version(self)
   2766         mw_ver, cache_time = getattr(self, '_mw_version_time', (None, None))
   2767         if mw_ver is None or time.time() - cache_time > 60 * 60 * 24:
-> 2768             mw_ver = MediaWikiVersion(self.version())
   2769             setattr(self, '_mw_version_time', (mw_ver, time.time()))
   2770         return mw_ver

/srv/paws/pwb/pywikibot/site.py in version(self)
   2749             try:
   2750                 version = self.siteinfo.get('generator',
-> 2751                                             expiry=1).split(' ')[1]
   2752             except pywikibot.data.api.APIError:
   2753                 # May occur if you are not logged in (no API read permissions).

/srv/paws/pwb/pywikibot/site.py in get(self, key, get_default, cache, expiry)
   1669                 elif not Siteinfo._is_expired(cached[1], expiry):
   1670                     return copy.deepcopy(cached[0])
-> 1671         preloaded = self._get_general(key, expiry)
   1672         if not preloaded:
   1673             preloaded = self._get_siteinfo(key, expiry)[key]

/srv/paws/pwb/pywikibot/site.py in _get_general(self, key, expiry)
   1615                     .format("', '".join(props)), _logger)
   1616             props += ['general']
-> 1617             default_info = self._get_siteinfo(props, expiry)
   1618             for prop in props:
   1619                 self._cache[prop] = default_info[prop]

/srv/paws/pwb/pywikibot/site.py in _get_siteinfo(self, prop, expiry)
   1538         request._warning_handler = warn_handler
   1539         try:
-> 1540             data = request.submit()
   1541         except api.APIError as e:
   1542             if e.code == 'siunknown_siprop':

/srv/paws/pwb/pywikibot/data/api.py in submit(self)
   2426         cached_available = self._load_cache()
   2427         if not cached_available:
-> 2428             self._data = super(CachedRequest, self).submit()
   2429             self._write_cache(self._data)
   2430         else:

/srv/paws/pwb/pywikibot/data/api.py in submit(self)
   2253                     continue
   2254                 raise NoUsername('Failed OAuth authentication for %s: %s'
-> 2255                                  % (self.site, info))
   2256             if code == 'cirrussearch-too-busy-error':  # T170647
   2257                 self.wait()

NoUsername: Failed OAuth authentication for wikipedia:test: The authorization headers in your request are for a user that does not exist here