Bugs item #2704124, was opened at 2009-03-22 20:26
Message generated for change (Tracker Item Submitted) made by tjgolden
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2704124&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: Open
Resolution: None
Priority: 7
Private: No
Submitted By: Tim Golden (tjgolden)
Assigned to: Nobody/Anonymous (nobody)
Summary: GetCompressedFileSize fails for some unicode filenames
Initial Comment:
I have a filename which contains the unicode codepoint U+F022. win32file.GetCompressedFileSize fails to cope with this name, returning error ERROR_INVALID_NAME. I can, however, call the underlying -W function from ctypes which works correctly. I suspect that the -W version of the function isn't in fact being used. My experience is that the -A functions will work on "simple" unicode -- those which can be encoded/decoded by the default encoding -- but will fail on "deeper" unicode, such as my example above which uses a private-space code point. (It's a real-life example, altho' I've no idea how it got there).
Example:
<code>
filename = u"\uf022.txt"
open (filename, "w").close ()
import win32file
print win32file.GetCompressedFileSize (filename)
import ctypes
from ctypes import wintypes
size = wintypes.DWORD ()
print ctypes.windll.kernel32.GetCompressedFileSizeW (filename, ctypes.byref (size))
</code>
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2704124&group_id=78018
|