mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
bpo-25083: Python can sometimes create incorrect .pyc files (GH-8449)
Python 2 never checked for I/O error when reading .py files and thus could mistake an I/O error for EOF and create incorrect .pyc files. This adds an check for this and aborts on an error.
This commit is contained in:
@@ -1654,6 +1654,9 @@ err_input(perrdetail *err)
|
||||
Py_XDECREF(tb);
|
||||
break;
|
||||
}
|
||||
case E_IO:
|
||||
msg = "I/O error while reading";
|
||||
break;
|
||||
case E_LINECONT:
|
||||
msg = "unexpected character after line continuation character";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user