Index: Python/pythonrun.c =================================================================== --- Python/pythonrun.c (revision 76915) +++ Python/pythonrun.c (working copy) @@ -864,6 +864,11 @@ *errors = '\0'; errors++; } + /* Not a fatal error if codec isn't available */ + if (!_PyCodec_Lookup(encoding)) { + PyErr_Clear(); + encoding = NULL; + } } /* Set sys.stdin */