BioJulia / Bio.jl

[DEPRECATED] Bioinformatics and Computational Biology Infrastructure for Julia
http://biojulia.dev
MIT License
261 stars 65 forks source link

Inexact error if you view a reader after it is closed #305

Closed TransGirlCodes closed 8 years ago

TransGirlCodes commented 8 years ago
julia> reader = open(FASTAReader, "data/2016/contig1_ac_good_depth_GOOD.fas")
Bio.Seq.FASTAReader{Bio.Seq.BioSequence}(Bio.Ragel.State{BufferedStreams.BufferedInputStream{IOStream}}(BufferedStreams.BufferedInputStream{IOStream}(<128.0 KiB buffer, 0% filled>),6,1),BufferedStreams.BufferedOutputStream{BufferedStreams.EmptyStream}(<1.0 KiB buffer, 0% filled>),Nullable{Bio.Seq.FASTAIndex}())

julia> reader
Bio.Seq.FASTAReader{Bio.Seq.BioSequence}(Bio.Ragel.State{BufferedStreams.BufferedInputStream{IOStream}}(BufferedStreams.BufferedInputStream{IOStream}(<128.0 KiB buffer, 0% filled>),6,1),BufferedStreams.BufferedOutputStream{BufferedStreams.EmptyStream}(<1.0 KiB buffer, 0% filled>),Nullable{Bio.Seq.FASTAIndex}())

julia> close(reader)

julia> reader
Bio.Seq.FASTAReader{Bio.Seq.BioSequence}(Bio.Ragel.State{BufferedStreams.BufferedInputStream{IOStream}}(Error showing value of type Bio.Seq.FASTAReader{Bio.Seq.BioSequence}:
ERROR: InexactError()
 in trunc(::Type{Int64}, ::Float64) at ./float.jl:463
 in show(::IOContext{Base.Terminals.TTYTerminal}, ::BufferedStreams.BufferedInputStream{IOStream}) at /Users/bward/.julia/v0.5/BufferedStreams/src/bufferedinputstream.jl:42
 in show_default(::IOContext{Base.Terminals.TTYTerminal}, ::Any) at ./show.jl:130
 in show(::IOContext{Base.Terminals.TTYTerminal}, ::Any) at ./show.jl:116
 in show_default(::IOContext{Base.Terminals.TTYTerminal}, ::Any) at ./show.jl:130
 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::Bio.Seq.FASTAReader{Bio.Seq.BioSequence}) at ./REPL.jl:132
 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::Bio.Seq.FASTAReader{Bio.Seq.BioSequence}) at ./REPL.jl:135
 in display(::Bio.Seq.FASTAReader{Bio.Seq.BioSequence}) at ./multimedia.jl:143
 in print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at ./REPL.jl:154
 in print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at ./REPL.jl:139
 in (::Base.REPL.##22#23{Bool,Base.REPL.##33#42{Base.REPL.LineEditREPL,Base.REPL.REPLHistoryProvider},Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at ./REPL.jl:652
 in run_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at ./LineEdit.jl:1579
 in run_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at /Users/bward/github/julia/usr/lib/julia/sys.dylib:?
 in run_frontend(::Base.REPL.LineEditREPL, ::Base.REPL.REPLBackendRef) at ./REPL.jl:903
 in run_repl(::Base.REPL.LineEditREPL, ::Base.##930#931) at ./REPL.jl:188
 in _start() at ./client.jl:360
 in _start() at /Users/bward/github/julia/usr/lib/julia/sys.dylib:?
bicycle1885 commented 8 years ago

It seems to be a problem of BufferedStreams.jl. I'll take a look shortly.

bicycle1885 commented 8 years ago

Need to be confirmed that this is fixed by https://github.com/BioJulia/BufferedStreams.jl/pull/25 after tagging and releasing it.

bicycle1885 commented 8 years ago

I've confirmed that #316 fixes the problem.