geopython / pywps

PyWPS is an implementation of the Web Processing Service standard from the Open Geospatial Consortium. PyWPS is written in Python.
https://pywps.org
MIT License
177 stars 117 forks source link

Error message when a temporary file is removed on Windows 8 #150

Closed geoslegend closed 8 years ago

geoslegend commented 8 years ago

Description

When a temporary file is removed on Windows 8, the error message is shown as

Traceback (most recent call last):
  File "D:\dev\python27_64\lib\site-packages\pywps-4.0.0a2-py2.7.egg\pywps\app\P
rocess.py", line 297, in clean
    shutil.rmtree(self.workdir)
  File "D:\dev\python27_64\lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "D:\dev\python27_64\lib\shutil.py", line 250, in rmtree
    os.remove(fullname)
WindowsError: [Error 32] : 'd:\\pywps\\temp\\pyws_process_shbh59\\tmpc3n0h0'

After 'os.remove(fullname)' syntax was packed by try/catch pattern, I could solve the above problem. So I would like to request to pack try/catch pattern for users who develop on Windows OS environment.

Environment

jachym commented 8 years ago

Hi,

how did you get PyWPS downloaded? This should be fixed in current "master" branch as well as in beta1 version

https://github.com/geopython/PyWPS/blob/master/pywps/app/Process.py#L297

geoslegend commented 8 years ago

Hi,

I downloaded it on July 22 2016, but today I re-downloaded using the following command and re-tested .

git clone https://github.com/geopython/pywps.git

However, the same error message is still shown:

Traceback (most recent call last):
  File "D:\dev\python27_64\lib\site-packages\pywps-4.0.0a2-py2.7.egg\pywps\app\S
ervice.py", line 368, in _parse_and_execute
    wps_response = process.execute(wps_request, uuid)
  File "D:\dev\python27_64\lib\site-packages\pywps-4.0.0a2-py2.7.egg\pywps\app\P
rocess.py", line 166, in execute
    wps_response = self._execute_process(async, wps_request, wps_response)
  File "D:\dev\python27_64\lib\site-packages\pywps-4.0.0a2-py2.7.egg\pywps\app\P
rocess.py", line 210, in _execute_process
    wps_response = self._run_process(wps_request, wps_response)
  File "D:\dev\python27_64\lib\site-packages\pywps-4.0.0a2-py2.7.egg\pywps\app\P
rocess.py", line 274, in _run_process
    wps_response.update_status(msg, -1)
  File "D:\dev\python27_64\lib\site-packages\pywps-4.0.0a2-py2.7.egg\pywps\app\W
PSResponse.py", line 54, in update_status
    self.write_response_doc(self.doc)
  File "D:\dev\python27_64\lib\site-packages\pywps-4.0.0a2-py2.7.egg\pywps\app\W
PSResponse.py", line 68, in write_response_doc
    self.process.clean()
  File "D:\dev\python27_64\lib\site-packages\pywps-4.0.0a2-py2.7.egg\pywps\app\P
rocess.py", line 296, in clean
    shutil.rmtree(self.workdir)
  File "D:\dev\python27_64\lib\shutil.py", line 256, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "D:\dev\python27_64\lib\shutil.py", line 254, in rmtree
    os.rmdir(path)
WindowsError: [Error 32] : 'd:\\pywps\\temp\\pyws_process_iofq5h'

I think this error causes by temporary file lock. In order to test PyWPS 4 on Windows OS environment, I think I need try/catch pattern.

tomkralidis commented 8 years ago

FYI PR issued in #194

tomkralidis commented 8 years ago

Merged and fixed in master.