raphaeldussin / ESMPy3

ESMPy wrapper for ESMF python3-compatible
Other
2 stars 6 forks source link

problem passing rc as ctype in cbindings.py #1

Closed raphaeldussin closed 8 years ago

raphaeldussin commented 8 years ago

raphael-ramoth:~/ESMF/ESMPy3/examples python create_read_from_file.py Traceback (most recent call last): File "create_read_from_file.py", line 24, in filetype=ESMF.FileFormat.GRIDSPEC) File "/opt/Anaconda3/4.1.1/lib/python3.5/site-packages/ESMF/util/decorators.py", line 64, in new_func return func(_args, _kwargs) File "/opt/Anaconda3/4.1.1/lib/python3.5/site-packages/ESMF/api/grid.py", line 240, in init coordNames=coord_names) File "/opt/Anaconda3/4.1.1/lib/python3.5/site-packages/ESMF/util/decorators.py", line 52, in new_func return func(_args, _kwargs) File "/opt/Anaconda3/4.1.1/lib/python3.5/site-packages/ESMF/util/decorators.py", line 76, in new_func return func(_args, *_kwargs) File "/opt/Anaconda3/4.1.1/lib/python3.5/site-packages/ESMF/interface/cbindings.py", line 444, in ESMP_GridCreateFromFile coordNames, ct.byref(lrc) ) ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type

rokuingh commented 8 years ago

This is actually due to the "filename" argument to GridCreateFromFile, not the rc. It comes from the changes to the default character encodings in Python3. This issue is resolved in a pull request, with a class call Py3Char in the cbindings.py file.

raphaeldussin commented 8 years ago

solved by merge