Forgot to say: the two randoms characters are different everytime the error appears, even if triggered by the same acition (e.g. click the upload button on the Install Themes screen).
I’m having exactly the same problem, but it’s on themes.php!
It keeps spitting the message:
Fatal error: Cannot run code from this file in conjunction with non encoded files in xà on line 369
whenever I try to search for installed themes in the search field.