List of steps to reproduce (step by step, including full links if applicable):
- Change into a directory the current user does not have permission to create directories
- Run Site().login()
What happens?:
FileNotFoundError: b'[Errno 2] No such file or directory'" eg T295115
This seems to be due to the generic exception handling of OSError in https://gerrit.wikimedia.org/r/plugins/gitiles/pywikibot/core/+/5878687e53b9ba27ade510a2187ec2a68d4c3207/pywikibot/data/api.py#1941
What should have happened instead?:
Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc: