Comment 41 for bug 335362

Revision history for this message
methane (songofacandy) wrote : Re: [Bug 335362] Re: [master] UnicodeDecodeError when processing paths that have the non-ascii characters

I can init from TBZR in "あいう" (Japanese, my codepage).
But I can't init in '天龙' (not in my codepage)

Following 2 patches fix it:

1. tbzrlib/vcspath.py
@@ -82,7 +82,7 @@
             # *sob* - I can't make stat() give me a float on Windows, even
             # after calling os.stat_float_times(True)
             self._attr, ctime, atime, self._mtime, size = \
- win32file.GetFileAttributesEx(self.path)
+ win32file.GetFileAttributesExW(self.path)
         except (win32file.error, os.error):
             self._attr = None
             self._mtime = None

2. bzrlib/win32util.py

 def set_file_attr_hidden(path):
     """Set file attributes to hidden if possible"""
     if has_win32file:
- win32file.SetFileAttributes(path, win32file.FILE_ATTRIBUTE_HIDDEN)
+ win32file.SetFileAttributesW(path, win32file.FILE_ATTRIBUTE_HIDDEN)

--
Naoki INADA <email address hidden>