EnesYildirim / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

Python crashes when ppening an OPeNDAP dataset on Windows from a directory without write access #129

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you try to use NetCDF4-python to open an OPeNDAP dataset on Windows from a 
directory without write access, Python crashes.   If you would like to try 
crashing your python (unless you have write permission to c:\windows), here's 
an example:

import os
import netCDF4
os.chdir('c:\windows')
url='http://geoport.whoi.edu/thredds/dodsC/bathy/adria15'
nc=netCDF4.Dataset(url)

According to Christoph Gohlke, NetCDF wants to write a temporary file when 
accessing OPeNDAP files, and apparently it wants to write in the current 
directory.   And I guess if it can't write, Python crashes. 

I don't know if there is anything NetCDF4-Python can do about this, because I 
guess the basic problem is probably on the Unidata side, but I thought I would 
mention it here to help explain to others with the same problem.

This came up because we were using NetCDF4-Python from the Python within 
ArcGIS, and the default directory was (c:\windows\system32) which of course is 
not typically writable by an ordinary user also. 

-Rich

Original issue reported on code.google.com by rsignell on 25 Jun 2012 at 8:14

GoogleCodeExporter commented 8 years ago
Rich - please report this to the unidata folks.  You are correct that there is 
nothing that can be done on the python side (since it's the C lib writing the 
temp file).  Seems like a pretty serious bug to me though which makes the 
library virtually useless on Windows.

Original comment by whitaker.jeffrey@gmail.com on 25 Jun 2012 at 8:17

GoogleCodeExporter commented 8 years ago
Okay, I'll report it to Unidata.  It doesn't really make the library useless, 
since most people will be likely to work in a directory where they *do* have 
write access.  But it really is a serious bug, that's for sure. 

Original comment by rsignell on 25 Jun 2012 at 8:35

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 26 Feb 2014 at 2:04