I am getting a world age error when using urldownload (from package UrlDownload). Does anybody know why this might happen?
Here’s the error message:
‘’’
Info: tmp
ERROR: LoadError: MethodError: no method matching eof(::ZipFile.ReadableFile)
The applicable method may be too new: running in world age 27826, while current world is 27828.
Closest candidates are:
eof(::ZipFile.ReadableFile) at /home/brian/.julia/packages/ZipFile/fdYkP/src/ZipFile.jl:533 (method too new to be called from this world context.)
eof(::Base64.Base64DecodePipe) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Base64/src/decode.jl:126
eof(::IOStream) at iostream.jl:223
…
Stacktrace:
[1] readbytes!(::ZipFile.ReadableFile, ::Array{UInt8,1}, ::Int64) at ./io.jl:917
[2] read at ./io.jl:941 [inlined]
[3] read at ./io.jl:940 [inlined]
[4] read(::ZipFile.ReadableFile, ::Type{String}) at ./io.jl:945
[5] downloadcatalogs(::String) at /home/brian/repos/Raytracer/GlassCat/src/InitializeGlass.jl:24
[6] top-level scope at /home/brian/repos/Raytracer/GlassCat/src/InitializeGlass.jl:34
[7] include(::Function, ::Module, ::String) at ./Base.jl:380
[8] include(::Module, ::String) at ./Base.jl:368
[9] exec_options(::Base.JLOptions) at ./client.jl:296
[10] _start() at ./client.jl:506
in expression starting at /home/brian/repos/Raytracer/GlassCat/src/InitializeGlass.jl:34
‘’’
and here’s the function
module InitializeGlass
using UrlDownload
function downloadcatalogs(glassdirectory::String)
catalogs = ("https://www.nikon.com/products/optical-glass/assets/pdf/nikon_zemax_data.zip",
"https://www.oharacorp.com/xls/OHARA_201130_CATALOG.zip",
"https://hoyaoptics.com/wp-content/uploads/2019/10/HOYA20170401.zip")
getzip(url) = urldownload(url,compress = :zip, parser = identity)
@info glassdirectory
for url in catalogs
# try
zipcat = getzip(url)
filename = replace(zipcat.name, r"""[ ,.:;?!()&-]""" => "_")
filename = replace(filename, "_agf" => ".agf")
filename = replace(filename, "_AGF" => ".agf")
temp = read(zipcat,String)
catname = joinpath(glassdirectory,filename)
@info "writing $catname"
write(joinpath(glassdirectory,filename),temp)
# catch err
# continue #if download fails for any reason continue to the next catalog
# end
end
end
downloadcatalogs(ARGS[1])
end #module