Closed lbesnard closed 9 years ago
Hi lbesnard,
This issue is caused by the files contain the non-ASCII characters in attributes. I have resolved this by set default encoding to UTF-8. The happens for all checkers and it needs to be fixed in IOOS checker as well. I will create a separated branch and send a pull-request.
Thanks, Ming
How about using the system's locale for that? It'd be much more accurate than hardcoding it to UTF-8.
How about using the system's locale for that? It'd be much more accurate than hardcoding it to UTF-8.
from what I understand, the issue is file based, and not env based
And do the files declare their encoding?
The default encoding for Python is ASCII, Python can get system default encoding by sys.getfilesystemencoding(), which can be further set as default in Python through: reload(sys) sys.setdefaultencoding(sys.getfilesystemencoding())
We're not quite interested in the filesystem settings, but more in either what NetCDF is publishing (if it does at all), or alternatively, use the system's locale for that.
The default encoding for netcdf-python library is ''utf-8' and this should be used, I believe.
That's fine too. It's unlikely we'll use anything other than UTF-8
in the foreseeable future. However as best practice I think it's good if it can be overriden by environment - should it ever be required.
It seems this is not actually an issue with the filename checker, and the encoding problem has been reported to IOOS (https://github.com/ioos/compliance-checker/issues/108), so I think we can close this.
@fxmzb123 I found some issues with the new imos-file-name test
see the following two files :
The test fail for both files
This file works though :
cheers