[Patches] [ python-Patches-1709112 ] test_1686475 of test_os & pagefile.sys

SourceForge.net noreply at sourceforge.net
Sat Apr 28 08:35:31 CEST 2007


Patches item #1709112, was opened at 2007-04-28 06:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1709112&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tests
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: A.B., Khalid (abkhd)
Assigned to: Nobody/Anonymous (nobody)
Summary: test_1686475 of test_os & pagefile.sys 

Initial Comment:
test_1686475 of test_os appears to rely on the
existence of "pagefile.sys" on the C drive like so:

def test_1686475(self):
    # Verify that an open file can be stat'ed
    try:
        os.stat(r"c:\pagefile.sys")
    except WindowsError, e:
        if e == 2: # file does not exist; cannot run test
            return
        self.fail("Could not stat pagefile.sys")


But since pagefile.sys may not be on every C
drive and since the exception object e is not a numeric then that test is probably going to fail if the pagefile.sys does not exist where it is expected.

In such a case Windows returns "[Error 5] Access is denied: 'c:\\pagefile.sys'". So we need to test if e.winerror == 5 to skip this and return without failing.

Patch "test_os.patch" is attached. 

By the way, I see the same problem in the trunk, so maybe this need to be applied there as well.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1709112&group_id=5470


More information about the Patches mailing list