Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Oct 7, 2019

Calling _Py_wfopen() is enough to check if filename is an existing
file or not. There is no need to check first isfile().

https://bugs.python.org/issue38353

Calling _Py_wfopen() is enough to check if filename is an existing
file or not. There is no need to check first isfile().
@vstinner
Copy link
Member Author

vstinner commented Oct 7, 2019

The pybuilddir.txt configuration file was introduced by https://bugs.python.org/issue9589 with commit e9b428f:

commit e9b428f9977f8733e6b0d2c321c093779f95080f
Author: Antoine Pitrou <solipsis@pitrou.net>
Date:   Fri Aug 13 22:25:01 2010 +0000

    Reimplement addbuilddir() in C inside getpath.c, so as to execute it
    at interpreter startup before importing any non-builtin modules.
    Should fix #9589.

The code evolved a lot since 2010 which made the isfile() call redundant.

cc @pitrou

@vstinner vstinner merged commit b96145a into python:master Oct 7, 2019
@vstinner vstinner deleted the pybuilddir2 branch October 7, 2019 10:57
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
Calling _Py_wfopen() is enough to check if filename is an existing
file or not. There is no need to check first isfile().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants