rigoudyg / climaf

CliMAF - a Climate Model Analysis Framework - doc at : http://climaf.readthedocs.org/
Other
18 stars 7 forks source link

.baseFiles() returns a unicode instead of string #174

Open jservonnat opened 4 years ago

jservonnat commented 4 years ago

@rigoudyg the .baseFiles() method of the climaf dataset returns now a unicode instead of a string. Is it on purpose? If yes I will fix the bugs associated with this change wherever I find them, if not can we simply keep the string as output?

jservonnat commented 4 years ago

@rigoudy actually it looks like all other methods return unicodes instead of string... this is the case for .crs, cfile() (not if target is specified),

rigoudyg commented 4 years ago

@jservonnat yes, this change is expected. Unicode becomes the default for strings in python3.

To bypass this difficulty, you should at least do the following changes :

It should resolve most problems with encoding.

Tell me if you need help, Gaëlle

P.S.: You can find other tips for python2-python3 compatibility here: http://python-future.org/compatible_idioms.html#strings-and-bytes