Opened 9 years ago
Closed 8 years ago
#2879 closed defect (fixed)
grass.script.array cannot read raster on Windows
Reported by: | annakrat | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | 7.2.0 |
Component: | Python | Version: | svn-trunk |
Keywords: | wingrass, numpy | Cc: | |
CPU: | Unspecified | Platform: | MSWindows 8 |
Description
When testing the example from documentation here
map2d_2.read("map2d_1")
doesn't work and fails because r.out.bin can't write into the temporary file. This file is created when the array is initialized and it is open, so on Windows no other process can write to it.
Change History (7)
comment:1 by , 9 years ago
Milestone: | 7.0.3 |
---|
follow-up: 4 comment:3 by , 9 years ago
This file is created when the array is initialized and it is open, so on Windows no other process can write to it.
It's possible for multiple processes to write to the same file, but that may require specifying additional flags (which neither the underlying numpy.memmap constructor nor Python's mmap.mmap constructor appear to support). OTOH, it's also possible that Windows doesn't allow writing to files which are memory-mapped.
It isn't possible to avoid opening the file in the constructor, so the only other option would be to optionally pass the mapname and null parameters to the constructor and have the constructor call the read() method before calling the parent constructor.
follow-up: 5 comment:4 by , 9 years ago
Milestone: | 7.0.4 → 7.1.0 |
---|
Replying to glynn:
It isn't possible to avoid opening the file in the constructor, so the only other option would be to optionally pass the mapname and null parameters to the constructor and have the constructor call the read() method before calling the parent constructor.
I implemented this in r67710 some time ago and tested on Linux and Windows. I don't think we should backport it, since it changes the API. If people agree, I would close this as solved.
comment:5 by , 9 years ago
comment:7 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Ticket retargeted after milestone closed