Skip to content

Allow indexing FileTree with string keys with path components in them #67

@mbauman

Description

@mbauman

Currently:

julia> filetree["path/to/file.ext"]
ERROR: Path components cannot contain '/' or '\' (got "path/to/file.ext")
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] joinpath(path::DataSets.RelPath, xs::String)
   @ DataSets ~/data/.julia/packages/DataSets/DWg6S/src/paths.jl:28
 [3] getindex(tree::BlobTree{JuliaHubData.DataRepoCache}, name::String)
   @ DataSets ~/data/.julia/packages/DataSets/DWg6S/src/BlobTree.jl:326
 [4] top-level scope
   @ REPL[96]:1

You need to use the special @path_str macro or explicitly construct a RelPath for this to work. It'd be nice to just allow using the complete key as a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions