This modification is triggered by the unicode lock . This latch will interpret the contents of all string literals and will try to avoid the invalid Unicode sequences again and remove the u / U string prefix:
def transform(self, node, results): ... elif node.type == token.STRING:
For some unknown reason (error?), Even if the source node is returned in step 3, lib2to3 still interprets this as changing the token tree, so it says “Files to change”. However, the source code is the same, so there is “No change to foo.py”.
If step 3 returns None instead, it really says, "There are no files that need to be changed."
The infected files will simply be overwritten with the original input. So the error is harmless.
source share