# open(name,'w') with '<' or '*' in name: OSError: [Errno 22] Invalid argument: 'a<b' (errno 22, winerror None) (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/open-name-w-with-or-in-name-oserror-errno-22-invalid-argument-a-b-errno-22-winerror-none-python-3-12-f8452c6c4017
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, oserror, windows

open('a<b','w') and open('a*b','w') raised plain OSError (not a subclass) with Errno 22; e.errno 22, e.winerror None, e.filename 'a<b'. os.strerror(22) is 'Invalid argument'.
