diff --git a/src/attributes.jl b/src/attributes.jl index 9af867dd1..0c683224a 100644 --- a/src/attributes.jl +++ b/src/attributes.jl @@ -173,13 +173,8 @@ end function write_attribute(attr::Attribute, memtype::Datatype, str::AbstractString) strbuf = Base.cconvert(Cstring, str) GC.@preserve strbuf begin - if API.h5t_is_variable_str(memtype) - ptr = Base.unsafe_convert(Cstring, strbuf) - write_attribute(attr, memtype, Ref(ptr)) - else - ptr = Base.unsafe_convert(Ptr{UInt8}, strbuf) - write_attribute(attr, memtype, ptr) - end + buf = Base.unsafe_convert(Ptr{UInt8}, strbuf) + write_attribute(attr, memtype, buf) end end function write_attribute( diff --git a/test/attributes.jl b/test/attributes.jl index f94b97cf9..b2a710289 100644 --- a/test/attributes.jl +++ b/test/attributes.jl @@ -69,14 +69,3 @@ end close(f) end end - - -@testset "variable length strings" begin - filename = tempname() - h5open(filename, "w") do f - # https://github.com/JuliaIO/HDF5.jl/issues/1129 - attr = create_attribute(f, "attr-name", datatype(String), dataspace(String)) - write_attribute(attr, datatype(String), "attr-value") - @test attrs(f)["attr-name"] == "attr-value" - end -end \ No newline at end of file