Re: PyNIO error with latest Macports version of python

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 11 2010 - 13:18:19 MST

I was wrong about the Python version having anything to do with this
problem. I rebuilt my Python 2.6 version of PyNIO and encountered the
same problem. But then after spending some time with the debugger and
seeing that some of the source files were not syncing up properly I
realized that it really was a build issue: I was linking with the
wrong version of libnio.a.

It used to be that running 'make install' from the NCL directory
caused libnio.a to be installed, but our (not quite finished) effort
to make it possible to build PyNIO from source completely independent
of NCL and the rest of NCARG means that libnio.a is now installed
from its own directory. After running make install from the NIO
directory and rebuilding, the problem went away for both the Python
2.5 and 2.6 PyNIO installations.

  A more low-level explanation is that new type support has been added
to the NIO library recently and the PyNIO was using headers that were
newer and contained conflicting type information relative to the
version of libnio.a that was being linked. In Jeff's test this caused
the character data to be seen as type float resulting in an uncaught
fatal error.

So I am pretty sure this is the problem with some of the binaries that
Mary has provided via ftp lately. We are not sure whose versions may
have the problem. It just depends on whether a complete rebuild of the
source tree occurred or only the 'important' parts were regenerated,
inadvertently leaving out a crucial step in the process.

Anyone that thinks their ftp-supplied version is acting flaky should
let us know and we will give you a correctly-built version as soon as
possible. Just FYI, I believe that Mary is out on vacation Friday and
Monday, so it may not be possible to supply the new versions prior to
next week. But please don't hesitate to let us know as soon as
possible if you think you need a new version.
  -dave

On Feb 10, 2010, at 3:01 PM, David Brown wrote:

> Hi Jeff and Gary et al.,
>
> I have found that I can reproduce this error when I install the
> current version of PyNIO into a Python 2.5 environment. It does not
> occur with Python 2.6 and I suspect that is the reason I had not
> encountered it in my tests. I will try to track this down as soon as
> possible.
> -dave
>
>
> On Feb 10, 2010, at 2:33 PM, Jeff Whitaker wrote:
>
>> Gary Bates wrote:
>>>
>>> hi,
>>> On Feb 2, our IT group did a 'clean install' of python using
>>> Macports.
>>> Then they added the versions of PyNio and PyNGl that we'd been using
>>> before (from December 2009):
>>>
>>> PyNGL-1.3.1b1.macosx-10.3-i386.tar.gz
>>> PyNIO-1.3.0b3.macosx-10.4-i386.tar.gz
>>>
>>> This caused a python script -- which had been working successfully
>>> everyday for the previous month --- to break in PyNIO. The error
>>> comes in the assigning values to a character variable (see
>>> below). I
>>> don't see why I'm getting this error.
>>>
>>> We've confirmed that when we return to our previous install of
>>> python2.5, the script still runs successfully.
>>>
>>> I'm running python 2.5.4 on an intel mac (mac OS 10.5.8). The
>>> python
>>> script is attached.
>>>
>>> Gary
>>
>> Here's a much simpler script that triggers the error:
>>
>> import Nio
>> ncfileout = Nio.open_file('testchar.nc','w')
>> ncfileout.create_dimension('time', None)
>> varout = ncfileout.create_variable('charvar', 'c', ('time',))
>> varout[0]='x'
>> ncfileout.close()
>>
>> python testchar.py
>> fatal:FileWriteVar: Type mismatch, can't perform assignment
>> Traceback (most recent call last):
>> File "testchar.py", line 5, in <module>
>> varout[0]='x'
>> File
>> "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/
>> python2.5/site-packages/PyNIO/Nio.py",
>> line 364, in __setitem__
>> self._obj[xsel] = value
>> SystemError: error return without exception set
>>
>>
>> -Jeff
>>>
>>>
>>>
>>>
>>> get_jsw_fcsts: datestamp (20100202
>>> ) LT model_run (20100205): process 20100205
>>>
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/apcp.refcst_ens.grid.
>>> 020500.2010.nc
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/apcp.refcst_ens.grid.
>>> 020500.2010.nc
>>>
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/apcp.refcst_ens.grid.
>>> 020500.2010.nc
>>> - Updated
>>>
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/hgt.refcst_ens.spec.
>>> 020500.2010.nc
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/hgt.refcst_ens.spec.
>>> 020500.2010.nc
>>>
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/hgt.refcst_ens.spec.
>>> 020500.2010.nc
>>> - Updated
>>>
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/prmsl.refcst_ens.grid.
>>> 020500.2010.nc
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/prmsl.refcst_ens.grid.
>>> 020500.2010.nc
>>>
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/prmsl.refcst_ens.grid.
>>> 020500.2010.nc
>>> - Updated
>>>
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/temp.refcst_ens.spec.
>>> 020500.2010.nc
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/temp.refcst_ens.spec.
>>> 020500.2010.nc
>>>
>>> /nas/headnode1/jwhitaker/ensdata/2010020500/temp.refcst_ens.spec.
>>> 020500.2010.nc
>>> - Updated
>>>
>>> get_jsw_fcsts: generating nc files
>>> /mac_home/map
>>>
>>> fatal:FileWriteVar: Type mismatch, can't perform assignment
>>>
>>> Traceback (most recent call last):
>>> File "/home/map/netcdf/ens_jsw/linux/create_refcst_netcdf.py", line
>>> 151, in <module>
>>> levidsout[npert,nchar] = pert[nchar]
>>> File
>>> "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> python2.5/site-packages/PyNIO/Nio.py",
>>> line 364, in __setitem__
>>> self._obj[xsel] = value
>>> SystemError: error return without exception set
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> pyngl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>>
>>
>> --
>> Jeffrey S. Whitaker Phone : (303)497-6313
>> Meteorologist FAX : (303)497-6449
>> NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@noaa.gov
>> 325 Broadway Office : Skaggs Research Cntr 1D-113
>> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
>>
>> _______________________________________________
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Thu Feb 11 13:18:49 2010

This archive was generated by hypermail 2.1.8 : Thu Feb 18 2010 - 07:48:02 MST