# Problems with h5py after update

**URL:** <https://discourse.julialang.org/t/problems-with-h5py-after-update/2730>\
**Category:** General Usage\
**Created:** [March 17, 2017, 3:39pm UTC](https://discourse.julialang.org/t/problems-with-h5py-after-update/2730 "2017-03-17T15:39:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukasfischer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lukasfischer/32/6870_2.png) [@lukasfischer](https://discourse.julialang.org/u/lukasfischer)\
**Post date:** [March 17, 2017, 3:39pm UTC](https://discourse.julialang.org/t/problems-with-h5py-after-update/2730/1 "2017-03-17T15:39:05Z")

</div>

Hi, i was using h5py to access a specific dataset that is not yet supported by the HDF5 module.  
until lately, i was able to use

```julia
  f = h5py.File(filename, "r")
  aqLog = f["AcquisitionLog"]["Log"]
  logEntryDescription = aqLog[1][3]
  f[:close]()

```

Now it seems that h5py.File returns a Dict instead of a file handle and does not have a .close() anymore. I get

```julia
f[:close]()
KeyError: key :close not found
in getindex at base/dict.jl:688

```

the same for f.close() or close(f).

Did something change in Julia or is it a h5py issue? It’s not a problem if you want to open just one file, but after several thousands I get the error now that too many files are open.  
How can I close files opened with h5py.File() ?  
Thanks, Lukas

---

<div class="post-metadata">

**Author:** ![lukasfischer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lukasfischer/32/6870_2.png) [@lukasfischer](https://discourse.julialang.org/u/lukasfischer)\
**Post date:** [March 24, 2017, 6:54pm UTC](https://discourse.julialang.org/t/problems-with-h5py-after-update/2730/2 "2017-03-24T18:54:10Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [March 24, 2017, 9:26pm UTC](https://discourse.julialang.org/t/problems-with-h5py-after-update/2730/3 "2017-03-24T21:26:27Z")

</div>

It would help if you could provide a minimal reproducible example. Which versions of everything are you using?

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [March 24, 2017, 9:27pm UTC](https://discourse.julialang.org/t/problems-with-h5py-after-update/2730/4 "2017-03-24T21:27:20Z")

</div>

Have you reported an issue to the relevant Julia package to include the necessary functionality? Which is what, exactly?

---

<div class="post-metadata">

**Author:** ![lukasfischer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lukasfischer/32/6870_2.png) [@lukasfischer](https://discourse.julialang.org/u/lukasfischer)\
**Post date:** [March 27, 2017, 9:52am UTC](https://discourse.julialang.org/t/problems-with-h5py-after-update/2730/5 "2017-03-27T09:52:15Z")

</div>

[Here](https://github.com/JuliaIO/HDF5.jl/issues/379) I attached a zipped HDF5 file which can be read by the posted code fragment, if you have installed PyCall and the hdf5 lib.  
The problem is a very general one, the file object of the python lib seems to get converted into a Julia Dictionary, and this does not contain the close() method anymore. Reading contents is not even necessary to reproduce, I just can’t find a way to close a file opened with fid = h5py.File(filename, “r”) anymore.

The version I am using is:  
Julia: v"0.5.0"  
PyCall: 1.11.0

---

<div class="post-metadata">

**Author:** ![lukasfischer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lukasfischer/32/6870_2.png) [@lukasfischer](https://discourse.julialang.org/u/lukasfischer)\
**Post date:** [March 27, 2017, 10:01am UTC](https://discourse.julialang.org/t/problems-with-h5py-after-update/2730/6 "2017-03-27T10:01:12Z")

</div>

An issue is already reported in the HDF5 library [GitHub - JuliaIO/HDF5.jl: Save and load data in the HDF5 file format from Julia](https://github.com/JuliaIO/HDF5.jl) at  
[https://github.com/JuliaIO/HDF5.jl/issues/379](https://github.com/JuliaIO/HDF5.jl/issues/379)  
There is also a file attached to reproduce why I can’t use the native Julia lib.
