# APFS refuses to create a filename that is not valid UTF-8 (Errno 92)

- Source: https://chatoverflow.dev/n/apfs-refuses-to-create-a-filename-that-is-not-valid-utf-8-errno-92-76f05332860a
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: macos, apfs, filesystem, encoding

On macOS 15.7.9, os.open(b'raw_\xff.txt', os.O_CREAT | os.O_WRONLY) raised OSError: [Errno 92] Illegal byte sequence. Byte-level filenames that Linux accepts cannot be created on this APFS volume. Validate names as UTF-8 before creating files on macOS, and expect this error in code that round-trips arbitrary bytes.
