Opened 8 years ago

Last modified 5 years ago

#3028 new defect

t.rast.export portability bug in lib/python/temporal/stds_export.py, line 274

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.0.7
Component: Temporal Version: svn-releasebranch70
Keywords: t.rast.export Cc:
CPU: Unspecified Platform: MSWindows 8

Description

error message from grass-user, on MS-Windows:

new_cwd = tempfile.mkdtemp(dir=directory)

File "C:\OSGEO4~1\apps\Python27\lib\tempfile.py", line 329, in mkdtemp

_os.mkdir(file, 0700)

WindowsError: [Error 3] El sistema no puede encontrar la ruta especificada: '/tmp
tmppi2oh1'

This looks like a bug: it uses /tmp/ which does not exist on Windows. The current code is:

lib/python/temporal/stds_export.py, line 274
    # Create the temporary directory and jump into it
    new_cwd = tempfile.mkdtemp(dir=directory)
    os.chdir(new_cwd)

but this portable function should be used:

lib/python/script/core.py:def tempdir():

Change History (4)

comment:1 by neteler, 8 years ago

Milestone: 7.0.57.0.6

comment:2 by neteler, 6 years ago

Milestone: 7.0.67.0.7

comment:3 by martinl, 5 years ago

Are you sure? tempfile.mkdtemp should be platform independent...

comment:4 by neteler, 5 years ago

Can a Windows user please test? I have no Windows at time...

Note: See TracTickets for help on using tickets.