win32file module functions seem to fail very simple test case.

Kossay Omary kossay_omary at yahoo.com
Sat May 3 20:50:18 EDT 2003


I took a look at the WindowsXP system info tool and it says that thefaulting application is pythonw.exe and the faulting module is kernel32.dll I am using win32all-152 I also noticed in my system info tool, under "Loaded Module":1- Python module was marked as "Not Available", instead I found Python2.2 module.2- I did find the module PythoTypes22.dll but did not find the module Pythoncom22.dll (although it is found under C:\windows\system...) Any ideas???Thanks,Kossay

Kossay Omary <kossay at comcast.net> wrote:I am almost sure that this is a problem with my configuration or my use of the functions. I just do not know how to debug this. I am running the following code on WindowsXP with Python2.2 ,after I execfile('...') the following code, I get a message from windows that the application pythonw was aborted and it asksme if I want to send an error log to microsoft. The code (you need to create the dummy file C:\existing_file):Please help. These are my first steps with windows file handling. import win32file def closeFile(handle):
    handle.Close() def openFile(filename):
    # returns a handle to the Windows file
    return win32file.CreateFile(filename.upper(), win32file.GENERIC_READ, \
                                0, None, win32file.OPEN_EXISTING, 0, None) def readChar(handle):
    err = 0
    char = None
    err, char = win32file.ReadFile(handle, 1, None)
    return char if __name__ == '__main__':
    # this will now fail
    #handle = openFile('C:\\MyFiles\\Python\\Modem\\ttt')
    handle = openFile('C:\\existing_file')
    print readChar(handle)
    closeFile(handle)


---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20030503/a653ffee/attachment.html>


More information about the Python-list mailing list