[New-bugs-announce] [issue38167] O_DIRECT read fails with 4K mmap buffer

Paul report at bugs.python.org
Fri Sep 13 19:28:40 EDT 2019

New submission from Paul <paul.carlisle at gmail.com>:

The following Python3 script fails.

import mmap
import os

fd = os.open(path_to_file, os.O_DIRECT | os.O_RDWR)
fo = os.fdopen(fd, 'rb+')
m = mmap.mmap(-1, 4096)

But it worked for Python2.  It also works for any other multiple of 4K. For example:

m = mmap.mmap(-1, 8192)

Is fine!

components: IO
messages: 352397
nosy: yoyoyopcp
priority: normal
severity: normal
status: open
title: O_DIRECT read fails with 4K mmap buffer
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list