STINNER Victor added the comment: I'm able to reproduce the bug on koobs's FreeBSD CURRENT:
* stat() returns st_dev = 0xde4d0429ab * major(0xde4d0429ab) returns 0x29 * minor(0xde4d0429ab) returns 0x4d0400ab minor() truncates most significant bits. major/minor are defined in sys/types.h: https://github.com/freebsd/freebsd/blob/master/sys/sys/types.h#L372 #define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ #define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ The definition of minor() confirms that most significant bits are truncated by "& 0xffff00ff". I'm surprised that stat().st_dev returns a device larger than INT_MAX: 0xde4d0429ab. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31044> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com