JuliaCloud / AWSS3.jl

AWS S3 Simple Storage Service interface for Julia.
Other
48 stars 34 forks source link

Broken parsing of `S3Path`s containing colons in v0.8.8+ #205

Closed hannahilea closed 3 years ago

hannahilea commented 3 years ago

Our refactor of Base.tryparse(...) in #182 broke path parsing for S3Paths that contain colons (which are officially supported as object keys: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html):

With AWSS3.jl v0.8.7

julia> using AWSS3
julia> S3Path("s3://fun_times_in:debugging_land")
p"s3://fun_times_in:debugging_land"

With AWSS3.jl v0.8.8

julia> using AWSS3
julia> S3Path("s3://fun_times_in:debugging_land")
p"s3://fun_times_in"

The updated (broken) parsing: https://github.com/beacon-biosignals/AWSS3.jl/blob/86c22ce3596368930f2003b418d01e09a44e9644/src/s3path.jl#L110

Link to parsing function in URIs.jl: https://github.com/JuliaWeb/URIs.jl/blob/d481cf385c2e588cdce72d569c759e659c5ae707/src/URIs.jl#L88

omus commented 3 years ago

I believe you're correct the behaviour has changed with AWSS3.jl v0.8.8 but I don't think it is incorrect. The example you gave has a colon being used in the bucket name which I don't believe is supported: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html

hannahilea commented 3 years ago

Closing! User error, not a bug---my MWE was testing a path that had a colon in the bucket, which is NOT allowed (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). When moving the colon to the key, everything is as expected:

julia> using AWSS3
julia> S3Path("s3://bucket/fun_times_in:debugging_land")
p"s3://bucket/fun_times_in:debugging_land"
hannahilea commented 3 years ago

(jinx, @omus --- thanks! :) )