Open durack1 opened 5 years ago
@durack1 I think this is a duplicate of #77
(cdatm_py3) jypeter@obelix2 - ...jypeter - 45 >python
Python 3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 09:07:38)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cdms2
>>> f = cdms2.open('tmp/file.nc', 'rw+')
CDMS I/O error: Looking up file 796095077
cdunif: Unknown Error
Segmentation fault (core dumped)
(cdatm_py3) jypeter@obelix2 - ...jypeter - 46 >python
Python 3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 09:07:38)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cdms2
>>> f = cdms2.open('tmp/file.nc', 'r+')
CDMS system error: No such file or directory
CDMS I/O error: Opening file /home/users/jypeter/tmp/file.nc
Traceback (most recent call last):
File "/home/share/unix_files/cdat/miniconda3/envs/cdatm_py3/lib/python3.6/site-packages/cdms2/dataset.py", line 1281, in __init__
_fileobj_ = Cdunif.CdunifFile(path, mode)
OSError: No error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/share/unix_files/cdat/miniconda3/envs/cdatm_py3/lib/python3.6/site-packages/cdms2/dataset.py", line 499, in openDataset
return CdmsFile(path, mode, mpiBarrier=CdMpi)
File "/home/share/unix_files/cdat/miniconda3/envs/cdatm_py3/lib/python3.6/site-packages/cdms2/dataset.py", line 1283, in __init__
raise CDMSError('Cannot open file %s (%s)' % (path, err))
cdms2.error.CDMSError: Cannot open file /home/users/jypeter/tmp/file.nc (No error)
>>>
@dnadeau4 @jypeter is right, when this bug is fixed you can close out both this #335 and #77 as dupes
@dnadeau4 so the link above means that rw+
is an accepted mode, whereas this causes a segfault?
This will destroy the self
object and return Null. Either destroying the self
object causes the segfault or the calling function. Actually "rw+" is not acceptable, only "r,w,a,r+,w+,a+".
It would help that a user that provides the option rw+
then gets a warning to say that it's defaulting to w+
and the process continues. I think defaulting to w+
is a safe default to me.
Not sure what @pochedls or @doutriaux1 think
@durack1 - I don't remember. w+ doesn't clobber the file does it? I think this is what I would want assuming it doesn't trash what is already in the file if it exists.
@pochedls good point, I am not 100% certain that w+
will not clobber files, I think you're right, any default mode should leave a file (and data) intact, and just allow editing by default
I think I am hitting same issue after installing recent nightly version. I cannot even import cdms2. Any progress?
(pmp_nightly_20190520) -bash-4.1$ p
Python 3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 09:07:38)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cdms2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/export/lee1043/anaconda2/envs/pmp_nightly_20190520/lib/python3.6/site-packages/cdms2/__init__.py", line 8, in <module>
from . import dataset
File "/export/lee1043/anaconda2/envs/pmp_nightly_20190520/lib/python3.6/site-packages/cdms2/dataset.py", line 8, in <module>
from . import Cdunif
ImportError: libcdms.so: cannot open shared object file: No such file or directory
>>>
(pmp_nightly_20190520) -bash-4.1$ conda list cdms2
# packages in environment at /export/lee1043/anaconda2/envs/pmp_nightly_20190520:
#
# Name Version Build Channel
cdms2 3.1.3 pypi_0 pypi
conda-forge updated netcdf and it broke cdms2... Please use:
conda install -f -c cdat/label/nightly -c conda-forge libnetcdf=4.6.2
@doutriaux1 unfortunately it is not solving my issue...
@lee1043 this is a different issue, but run to for an update of libcdms
.
conda install -f -c cdat/label/nightly -c conda-forge libcdms libnetcdf=4.6.2
cannot import name 'Cdunif'
import cdms2
ImportError Traceback (most recent call last)
The following will reproduce the issue: