[GRASS-dev] [GRASS GIS] #3148: d.wms cannot move temp file with os.rename
GRASS GIS
trac at osgeo.org
Sat Sep 10 09:00:43 PDT 2016
#3148: d.wms cannot move temp file with os.rename
--------------------------+-------------------------
Reporter: kuszinger | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.0
Component: Display | Version: svn-trunk
Keywords: wms, display | CPU: Unspecified
Platform: Linux |
--------------------------+-------------------------
In Python on some Linuces/Unices os.rename won't work when the source and
target are on different physical volumes. This is a known Python
limitation in os.rename().
Solution is import shutil and use that for file moving (=renaming)
Household tested, works :)
{{{
import os
import sys
+import shutil
}}}
And then:
{{{
# os.rename(temp_map, os.environ["GRASS_RENDER_FILE"])
shutil.move(temp_map, os.environ["GRASS_RENDER_FILE"])
}}}
I have no access to dev SVN ( and this is just good like this :) - so I
post the ticket and solution here.
I recommend to fix it also back in 7.2 if possible.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3148>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list