-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
try to write all attributes as NC_CHAR (issue #529) #533
Conversation
to ascii, then write NC_CHAR if possible.
# try to convert to ascii string, write as NC_CHAR | ||
# else it's a unicode string, write as NC_STRING (if NETCDF4) | ||
try: | ||
if force_ncstring: raise UnicodeDecodeError("",b"",1,1,"") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this strange argument here to UnicodeDecodeError?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because UnicodeDecodeError has 5 mandatory args
that all have to be specified to raise it manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to UnicodeError, which doesn't require args.
try to write all attributes as NC_CHAR (issue #529)
only write NC_STRING if it can't be converted to ascii.