Page MenuHomePhabricator

NoUsername error
Closed, InvalidPublic


While trying to login to Pywikibot using the command python3 login, I am getting the following error

Skipped '/home/user/pywikibot/core_stable/': writeable by others.
family and mylang are not set.
Defaulting to family='wikipedia' and mylang='test'.
WARNING: No user is logged in on site wikipedia:test
Traceback (most recent call last):
  File "/home/user/pywikibot/core_stable/pywikibot/", line 115, in __init__
   user = code_to_usr.get(site.code) or code_to_usr['*']
KeyError: '*'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "", line 363, in <module>
   if not main():
  File "", line 355, in main
  File "", line 74, in run_python_file
   exec(compile(source, filename, 'exec', dont_inherit=True),
  File "./scripts/", line 192, in <module>
  File "./scripts/", line 174, in main
  File "/home/user/pywikibot/core_stable/pywikibot/tools/", line 1481, in wrapper
   return obj(*__args, **__kw)
  File "/home/user/pywikibot/core_stable/pywikibot/site/", line 333, in login
   login_manager = api.LoginManager(site=self, user=self.username())
  File "/home/user/pywikibot/core_stable/pywikibot/tools/", line 1481, in wrapper
   return obj(*__args, **__kw)
  File "/home/user/pywikibot/core_stable/pywikibot/", line 117, in __init__
   raise NoUsername(
pywikibot.exceptions.NoUsername: ERROR: username for wikipedia:test is undefined.
If you have a username for that site, please add a line to as follows:
usernames['wikipedia']['test'] = 'myUsername'
CRITICAL: Exiting due to uncaught exception <class 'pywikibot.exceptions.NoUsername'>

Since the wiki is a third party wiki, I have actually created file, added the family file and also created the file. But still the error is showing

Task copied from

Event Timeline

Could you please show your and the family file here. Seems the username is not found.

Contents of


Contents of

# -*- coding: utf-8 -*-
This family file was auto-generated by script.

Configuration parameters:
  url =
  name = school

Please do not commit this to the Git repository!
from pywikibot import family

class Family(family.Family):  # noqa: D101

    name = 'school'
    langs = {
        'ml': '',

    def scriptpath(self, code):
        return {
            'ml': '',

    def protocol(self, code):
        return {
            'ml': 'https',
    def ignore_certificate_error(self, code):
        return True
JJMC89 added a subscriber: JJMC89. is writeable by others, so it is not being read.

Thanks for the solution. I actually copied the same from Windows.