bpo-20844: open script file with "rb" mode (GH-12616)

This commit is contained in:
Inada Naoki 2019-04-01 18:35:20 +09:00 committed by GitHub
parent 62f9588663
commit 10654c19b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 1 deletions

View file

@ -283,7 +283,7 @@ static int
pymain_run_file(_PyCoreConfig *config, PyCompilerFlags *cf)
{
const wchar_t *filename = config->run_filename;
FILE *fp = _Py_wfopen(filename, L"r");
FILE *fp = _Py_wfopen(filename, L"rb");
if (fp == NULL) {
char *cfilename_buffer;
const char *cfilename;