Pino Toscano added the comment:

*_MAX constants are usually defined when the system declares that the maximum 
limit for that option exist and is already known at compile time.
Python should simply not rely on XATTR_LIST_MAX and XATTR_SIZE_MAX being 
defined, but just grow the buffers as needed until *getxattr / *listxattr 
succeed or fail with errno != ERANGE; it seems the case already, although the 
two *_MAX are used as kind of "upper bound" limit.

Instead of using short lists with sizes to try, what about starting from a size 
(e.g. 128 for getxattr and 256 for listxattr), and grow the buffer by adding 
the same value each iteration (or doubling the size)?

----------
nosy: +pino

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13669>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to