Skip to content

add support for opening file from memory #652

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

Merged
merged 12 commits into from
May 1, 2017
Prev Previous commit
Next Next commit
revert wrong behavior
  • Loading branch information
thehesiod committed Apr 30, 2017
commit 8b7bdbbf352dadb3b680fecead1027dd21827da2
97 changes: 19 additions & 78 deletions netCDF4/_netCDF4.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions netCDF4/_netCDF4.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1999,14 +1999,14 @@ version 4.1.2 or higher of the netcdf C lib, and rebuild netcdf4-python."""

Close the Dataset.
"""
try:
_ensure_nc_success(nc_close(self._grpid))
_ensure_nc_success(nc_close(self._grpid))

self._isopen = 0 # indicates file already closed, checked by __dealloc__
finally:
# per impl of PyBuffer_Release: https://github.com/python/cpython/blob/master/Objects/abstract.c#L667
# view.obj is checked, ref on obj is decremented and obj will be null'd out
PyBuffer_Release(&self._buffer)
self._isopen = 0 # indicates file already closed, checked by __dealloc__

# Only release buffer if close succeeded
# per impl of PyBuffer_Release: https://github.com/python/cpython/blob/master/Objects/abstract.c#L667
# view.obj is checked, ref on obj is decremented and obj will be null'd out
PyBuffer_Release(&self._buffer)

def isopen(self):
"""
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy