[GRASS-dev] Cannot move temp file with os.rename change

Re - #3148: d.wms cannot move temp file with os.rename

There are a few more places in which os.rename is used:

find . -type f | xargs grep "os.rename" | grep -v svn/pristine
./scripts/r.in.srtm/r.in.srtm.py: os.rename(hgtfile, bilfile)
./gui/wxpython/gis_set.py:
os.rename(os.path.join(self.gisdbase, location, mapset),
./gui/wxpython/gis_set.py:
os.rename(os.path.join(self.gisdbase, location),
./gui/wxpython/rlisetup/frame.py:
os.rename(os.path.join(self.rlipath, confile), newname)
./lib/python/gunittest/reporters.py: os.rename(tmp_file_path, file_path)
./man/build_html.py: os.rename(temp, name)
./man/build_rest.py: os.rename(temp, name)

... any others to be updated to use shutil.move() as done here
https://trac.osgeo.org/grass/changeset/69429

?

Markus

Hi,

2016-09-12 14:08 GMT+02:00 Markus Neteler <neteler@osgeo.org>:

This should be fine since we are renaming file in current directory:

./scripts/r.in.srtm/r.in.srtm.py: os.rename(hgtfile, bilfile)

These should be fine also since we expect gisdbase to be on one
physical drive (?):

./gui/wxpython/gis_set.py:
os.rename(os.path.join(self.gisdbase, location, mapset),
./gui/wxpython/gis_set.py:
os.rename(os.path.join(self.gisdbase, location),

Items bellow should be also fine since we are renaming file in given directory:

./gui/wxpython/rlisetup/frame.py:
os.rename(os.path.join(self.rlipath, confile), newname)
./lib/python/gunittest/reporters.py: os.rename(tmp_file_path, file_path)
./man/build_html.py: os.rename(temp, name)
./man/build_rest.py: os.rename(temp, name)

Ma

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa