I am probably using pywikibot in ways that were beyond the ways the project was intended. I want several users to use the same user-config.py
. Unfortunately this gives me this error:
WARNING: Skipped '...pywikibot/user-config.py': owned by someone else.
My current solution is to just comment some of this code at pywikibot/config2.py
:
_filestatus = os.stat(_filename)
_filemode = _filestatus[0]
_fileuid = _filestatus[4]
if sys.platform == 'win32' or _fileuid in [os.getuid(), 0]:
if sys.platform == 'win32' or _filemode & 0o02 == 0:
with open(_filename, 'rb') as f:
exec(compile(f.read(), _filename, 'exec'), _uc)
else:
print("WARNING: Skipped '%(fn)s': writeable by others."
% {'fn': _filename})
else:
print("WARNING: Skipped '%(fn)s': owned by someone else."
% {'fn': _filename})
I.e. I'm only keeping this part:
with open(_filename, 'rb') as f:
exec(compile(f.read(), _filename, 'exec'), _uc)
It's really not a great way to handle this. So I'm curious, is there a better way? Better: things won't break here if I (or someone else in the future) upgrades Pywikibot.
(Creating an issue in the Pywikibot bug tracker could be a good way to start work towards a more sustainable solution but the project is so spread out I can't really figure out where to do that.)