[Python-Dev] Python 2.5.1

Josiah Carlson jcarlson at uci.edu
Sun Apr 29 07:04:59 CEST 2007

"Khalid A. Bakr" <khabkr at yahoo.com> wrote:
> --- "Martin v. Löwis" <martin at v.loewis.de> wrote:
> > There must be more to the problem than just an open
> > file. Please undo the change that triggered the 
> > addition of the test, and see whether you
> > can reproduce the original problem with an arbitrary
> > open file (I
> > could trigger the problem with pagefile.sys at the 
> > time).
> >
> > Regards,
> > Martin
> --- "Calvin Spealman" <ironfroggy at gmail.com> wrote:
> > I'm sorry, but somehow I could not parse this. My 
> > understanding was that the unittest was meant to 
> > make sure an os.stat call would be successful on an
> > open file, and that pagefile.sys was >simply used as
> > a known open file, which is no longer correct. If 
> > that is the case, I am unsure what problem there is
> > with >my fix of a temporary open file to test upon
> I think the point is that the problem should be solved
> (stat of open file) for any arbitrary open file
> including pagefile.sys.

On Windows there is no guarantee that there will be a pagefile.sys on
the C drive, or even that there exists a C drive.  The test checking for
the result of os.stat('C:\\pagefile.sys') is broken.  Create a temporary
file, open it with Python, then stat it (like you later suggest). 
Either that or use sys.executable .  Either one would likely be fine.

 - Josiah

More information about the Python-Dev mailing list