-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add warning for netCDF4 bug #1835
Changes from 7 commits
50d35fe
bdde9c3
f868f30
95ac10b
9c4f0ca
006ede6
38ade07
e5d7a92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
from glob import glob | ||
from io import BytesIO | ||
from numbers import Number | ||
|
||
import warnings | ||
|
||
import numpy as np | ||
|
||
|
@@ -281,6 +281,14 @@ def maybe_decode_store(store, lock=False): | |
engine = _get_default_engine(filename_or_obj, | ||
allow_remote=True) | ||
if engine == 'netcdf4': | ||
import netCDF4 | ||
if len( filename_or_obj ) == 88 and float(netCDF4.__version__[:3]) < 1.3: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove spaces around |
||
warnings.warn('\nA segmentation fault may occur when the \n' | ||
'file path has exactly 88 characters. The issue is known \n' | ||
'to occur with version 1.2.4 of netCDF4 and can be \n' | ||
'addressed by upgrading netCDF4 to at least version 1.3.1. \n' | ||
'More details can be found here: \n' | ||
'https://github.com/pydata/xarray/issues/1745 \n') | ||
store = backends.NetCDF4DataStore.open(filename_or_obj, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you put this inside |
||
group=group, | ||
autoclose=autoclose) | ||
|
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.
It looks like you accidentally kept your changes in this file?
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.
I thought that I had checked out the original version again to replace all of my edits, but that doesn't seem to have worked. I'm looking for a solution.
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.
You can simply revert this file (e.g., copy/paste from master) and then add another commit
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.
I was worried that would cause some new unforeseen problem. I've commited this now.