Comment 6 for bug 967060

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [win32] `bzr add file` in git tree fails with traceback

From bzrlib._walkdirs_win32:

cdef class _Win32Stat:
    """Represent a 'stat' result generated from WIN32_FIND_DATA"""

    cdef readonly int st_mode
    cdef readonly double st_ctime
    cdef readonly double st_mtime
    cdef readonly double st_atime
    # We can't just declare this as 'readonly' because python2.4 doesn't define
    # T_LONGLONG as a structure member. So instead we just use a property that
    # will convert it correctly anyway.
    cdef __int64 _st_size

    property st_size:
        def __get__(self):
            return self._st_size

    # os.stat always returns 0, so we hard code it here
    cdef readonly int st_dev
    cdef readonly int st_ino

    def __repr__(self):
        """Repr is the same as a Stat object.

        (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)
        """
        return repr((self.st_mode, 0, 0, 0, 0, 0, self.st_size, self.st_atime,
                     self.st_mtime, self.st_ctime))

It seems that implementation just misses declaration of

cdef readonly int st_uid
cdef readonly int st_gid

So, I think we should fix _Win32Stat class in bzrlib.