`load` fails when mixing forward and backward slashes on Windows network paths
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 228
- Forks
- 81
- Avg merge
- 1d 29m
- Merged PRs (30d)
- 1
Description
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)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure in FileIO.load with the Windows network paths shown, then inspect FileIO's loadsave.jl and error_handling.jl at the stack-trace locations. Trace how mixed forward and backward slashes are normalized; done means load accepts these paths without mangling them or reporting a spurious trailing slash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100