Paul <paul.carli...@gmail.com> added the comment:

> I agree with Josh. If you want to use O_DIRECT, use an unbuffered file object 
> and be sure to issue reads of the right size.

I do not believe an unbuffered file uses O_DIRECT.  This is why I use 
os.open(fpath, os.O_DIRECT).

> Also I'm curious: why are you using O_DIRECT, and furthermore, why are you 
> using it to read into mmap'ed memory?

I am testing a storage device and must use O_DIRECT to avoid the kernel's 
cache.  I am using mmap because it was the simplest way to get a page-aligned 
memory buffer, which is required for direct IO.

I believe that this is a bug regardless of the use of mmap, especially 
considering that this worked in Python 2.  I believe the fix I have sent out 
for review addresses it adequately.

----------

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

Reply via email to