[Python-bugs-list] [Bug #123685] bug in extension handling Py_RunSimpleFile

noreply@sourceforge.net noreply@sourceforge.net
Tue, 28 Nov 2000 06:22:47 -0800


Bug #123685, was updated on 2000-Nov-28 04:49
Here is a current snapshot of the bug.

Project: Python
Category: Parser/Compiler
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: bug in extension handling Py_RunSimpleFile

Details: On line 559 of pythonrun.c there's an error:

ext = filename + strlen(filename) - 4;

This line assumes that the extension is 3 chars long, while it can be any size imaginable. Correct behaviour is to search the string from the end for a dot and use the string to the right of the dot as extension.

Floris

Follow-Ups:

Date: 2000-Nov-28 06:22
By: gvanrossum

Comment:
The code there is correct. The only use made of the ext variable is to compare it to various strings for equality, all of which are exactly 4 characters long. If the actual extension is not 4 characters long, that comparison can never succeed, so it doesn't matter that the ext variable is not pointing to the start of the extension.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=123685&group_id=5470