[issue21797] mmap read of single byte accesses more that just that byte

2014-06-17 Thread Kevin Smith
New submission from Kevin Smith: I am using the mmap module on Linux with python 2.7.6 to access memory-mapped IO. The device that I am accessing implements a hardware FIFO that holds 16-bit values and pops an entry when the MSB of the entry is read. I am trying to use the mmap module to do

[issue21797] mmap read of single byte accesses more that just that byte

2014-06-17 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Kevin, mmap is not appropriate for your use. Looks like writing your own module would be simple enough. If performance is not a problem, maybe ctypes/cffi pointer magic encapsulate in your own custom class would be enough for you. I mark this bug as not a

[issue21797] mmap read of single byte accesses more that just that byte

2014-06-17 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: You could even use ctypes to access the underlining mmap OS syscall. But accessing individual bytes using native python is not guaranteed to work because python is too high level for that. For instance, it could read 64 bits (a word) to only use 8 at the