Black currently fails on files containing a carriage return in many positions, while Python itself is happy to treat \r as a newline.
For example:
import black
black.format_str("{\r}", mode=black.Mode())
This is obviously a trivial example, but the problem occurs for a fairly wide range of old Python code from e.g. MacOS, or when files are loaded without universal-newlines (which does still happen occasionally).
As a fix, I don't think it's worth trying to fix lib2to3, but 'on error check for \r, rewrite and retry' seems reasonable.