-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Open
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
pymain_run_file_obj attempts to skip the source first line before verifying that the file is not a directory.
Lines 382 to 401 in 4eab90f
| if (skip_source_first_line) { | |
| int ch; | |
| /* Push back first newline so line numbers remain the same */ | |
| while ((ch = getc(fp)) != EOF) { | |
| if (ch == '\n') { | |
| (void)ungetc(ch, fp); | |
| break; | |
| } | |
| } | |
| } | |
| struct _Py_stat_struct sb; | |
| if (_Py_fstat_noraise(fileno(fp), &sb) == 0 && S_ISDIR(sb.st_mode)) { | |
| PySys_FormatStderr("%S: %R is a directory, cannot continue\n", | |
| program_name, filename); | |
| fclose(fp); | |
| return 1; | |
| } | |
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error