Bugs item #2949837, was opened at 2010-02-11 18:00
Message generated for change (Comment added) made by neverjade
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2949837&group_id=78018
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: win32
Group: None
Status: Pending
Resolution: None
Priority: 5
Private: No
Submitted By: Christopher Nelson (neverjade)
Assigned to: Nobody/Anonymous (nobody)
Summary: CreateFile puportedly supports Transaction= but does not
Initial Comment:
The following code:
h = win32file.CreateFile(dst,
win32con.GENERIC_WRITE,
0,
None,
win32con.TRUNCATE_EXISTING if os.path.exists(dst) else win32con.CREATE_NEW,
0,
None,
Transaction=self.transaction)
win32file.WriteFile(h, data, None)
h.Close()
fails with pywin32-214 because:
Traceback (most recent call last):
File "C:\Users\cnelson\rbc\dev-01.00\Deploy\Installer\deployer\src\installer\_
_init__.py", line 115, in <module>
i.copy_from_memory("This shouldn't be here", "test.txt")
File "C:\Users\cnelson\rbc\dev-01.00\Deploy\Installer\deployer\src\installer\_
_init__.py", line 101, in copy_from_memory
Transaction=self.transaction)
TypeError: CreateFile() takes no keyword arguments
Both the ActiveState docs and the docs at http://timgolden.me.uk/pywin32-docs/win32file__CreateFile_meth.html say that CreateFile takes a Transaction= parameter.
----------------------------------------------------------------------
Comment By: Christopher Nelson (neverjade)
Date: 2010-02-11 18:55
Message:
That fixed it!
----------------------------------------------------------------------
Comment By: Roger Upole (rupole)
Date: 2010-02-11 18:53
Message:
CreateFileW is the function you'll need for transacted operations.
CreateFile will eventually be merged with CreateFileW when we
finally go to a completely unicode build, but for now it's a separate
function.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2949837&group_id=78018
|