_walkdirs_win32.pyx cannot be compiled with Python 2.4
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Unassigned |
Bug Description
bzr.dev revno.3763 , Pyrex 0.9.6.4, Python 2.4.4:
pyrexc bzrlib/
building 'bzrlib.
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DWIN32 -IC:\Python\
_walkdirs_win32.c
bzrlib\
bzrlib\
Building of "bzrlib.
This extension cannot be compiled because T_LONGLONG absent in Python 2.4.
Code in question:
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
cdef readonly __int64 st_size
# os.stat always returns 0, so we hard code it here
cdef readonly int st_dev
cdef readonly int st_ino
Interesting part is cdef readonly __int64 st_size. Pyrex generate following C-code:
static struct PyMemberDef __pyx_members_
{"st_mode", T_INT, offsetof(struct __pyx_obj_
{"st_ctime", T_DOUBLE, offsetof(struct __pyx_obj_
{"st_mtime", T_DOUBLE, offsetof(struct __pyx_obj_
{"st_atime", T_DOUBLE, offsetof(struct __pyx_obj_
{"st_size", T_LONGLONG, offsetof(struct __pyx_obj_
{"st_dev", T_INT, offsetof(struct __pyx_obj_
{"st_ino", T_INT, offsetof(struct __pyx_obj_
{0, 0, 0, 0, 0}
};
When MSVC trying to compile this it break with error:
bzrlib\
bzrlib\
I'm grepping 2.4 and 2.5 sources and found that in 2.5 this symbol defined in include/
as following:
#ifdef HAVE_LONG_LONG
#define T_LONGLONG 17
#define T_ULONGLONG 18
#endif /* HAVE_LONG_LONG */
But this definition is not there in Python 2.4.
I'm not sure that adding this definition manually will helps: if Python 2.4 has no support for this type it will likely to segfault in runtime.
Changed in bzr: | |
importance: | Undecided → High |
milestone: | none → 1.9rc1 |
status: | New → Fix Released |