Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3148 closed defect (fixed)

d.wms cannot move temp file with os.rename

Reported by: kuszinger Owned by: grass-dev@…
Priority: normal Milestone: 7.0.5
Component: Display Version: svn-trunk
Keywords: wms, display Cc:
CPU: Unspecified Platform: Linux

Description

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.

Change History (4)

comment:1 by martinl, 8 years ago

In 69429:

d.wms cannot move temp file with os.rename (see #3148

comment:2 by martinl, 8 years ago

In 69430:

d.wms cannot move temp file with os.rename (see #3148)

comment:3 by martinl, 8 years ago

Resolution: fixed
Status: newclosed

In 69431:

d.wms cannot move temp file with os.rename (fix #3148)

comment:4 by martinl, 8 years ago

Milestone: 7.2.07.0.5
Note: See TracTickets for help on using tickets.