Skip to content
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

load fails when mixing forward and backward slashes on Windows network paths #282

Open
yha opened this issue Nov 25, 2020 · 1 comment
Open

Comments

@yha
Copy link

yha commented Nov 25, 2020

The error message suggests that the filename is somehow mangled along the way:

julia> load("\\\\132.68.111.72\\sternlab/tmp.png")
Errors encountered while loading "\\\\132.68.111.72\\sternlab/tmp.png\\".
All errors:
===========================================
Failed to open \\132.68.111.72\sternlab/tmp.png\
===========================================
UnableToOpenBlob `\\132.68.111.72\sternlab/tmp.png\': Invalid argument @ error/blob.c/OpenBlob/2873
===========================================

Fatal error:
ERROR: Failed to open \\132.68.111.72\sternlab/tmp.png\
Stacktrace:
 [1] handle_error(::ErrorException, ::FileIO.File{FileIO.DataFormat{:PNG}}) at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\error_handling.jl:82
 [2] handle_exceptions(::Array{Any,1}, ::String) at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\error_handling.jl:77
 [3] load(::FileIO.Formatted; options::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\loadsave.jl:210
 [4] load at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\loadsave.jl:187 [inlined]
 [5] #load#16 at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\loadsave.jl:136 [inlined]
 [6] load(::String) at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\loadsave.jl:136
 [7] top-level scope at none:1

A different mangling with more forward slashes:

julia> load("\\\\132.68.111.72/sternlab/tmp.png")
ERROR: ArgumentError: No file exists at given path: \132.68.111.72\sternlab\tmp.png
Stacktrace:
 [1] load(::FileIO.Formatted; options::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\loadsave.jl:192
 [2] load at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\loadsave.jl:187 [inlined]
 [3] #load#16 at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\loadsave.jl:136 [inlined]
 [4] load(::String) at C:\Users\sternlab\.julia\packages\FileIO\2fEu2\src\loadsave.jl:136
 [5] top-level scope at none:1

(using FileIO 1.4.4 on Julia 1.5.2)

@timholy
Copy link
Member

timholy commented Mar 3, 2021

I can't replicate this because the URL seems interpreted as a filename on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants