Fallback to mode='denywrite' when memory mapping arrays if mode='readonly' fails.
Fallback to mode='denywrite' when memory mapping arrays if mode='readonly' fails.

Specifically, mode='readonly' results in the memory-mapping using the ACCESS_COPY mode in mmap so that users can modify arrays. However, on some systems, the OS raises a '[Errno 12] Cannot allocate memory' OSError if the address space is smaller than the file. The solution is to open the file in mode='denywrite', which at least allows the file to be opened even if the resulting arrays will be truly read-only.
pllim/astropy,mhvk/astropy,lpsinger/astropy,bsipocz/astropy,larrybradley/astropy,astropy/astropy,stargaser/astropy,dhomeier/astropy,pllim/astropy,lpsinger/astropy,bsipocz/astropy,mhvk/astropy,larrybradley/astropy,astropy/astropy,aleksandr-bakanov/astropy,lpsinger/astropy,dhomeier/astropy,bsipocz/astropy,mhvk/astropy,mhvk/astropy,saimn/astropy,saimn/astropy,MSeifert04/astropy,stargaser/astropy,astropy/astropy,aleksandr-bakanov/astropy,saimn/astropy,pllim/astropy,larrybradley/astropy,pllim/astropy,mhvk/astropy,aleksandr-bakanov/astropy,larrybradley/astropy,MSeifert04/astropy,dhomeier/astropy,larrybradley/astropy,aleksandr-bakanov/astropy,StuartLittlefair/astropy,MSeifert04/astropy,MSeifert04/astropy,pllim/astropy,lpsinger/astropy,StuartLittlefair/astropy,StuartLittlefair/astropy,dhomeier/astropy,lpsinger/astropy,stargaser/astropy,astropy/astropy,bsipocz/astropy,dhomeier/astropy,stargaser/astropy,astropy/astropy,StuartLittlefair/astropy,saimn/astropy,saimn/astropy,StuartLittlefair/astropy