Skip to content

The remove_dot_segments() function returns a relative path for an absolute input path after removing dot-dot segments. #111

Closed
@t3stme1x

Description

@t3stme1x

The remove_dot_segments() function returns an empty-string path for an absolute input path after removing dot-dot segments if the number of dot-dot segments is greater than the deepest path level. This is not compatible with the algorithm suggested by RFC3986 section-5.2.4.

INPUT: '/a/b/c/../../../../'
EXPECTED OUTPUT: '/'
Got: ''

Code snippet to reproduce the issue:

from rfc3986.normalizers import remove_dot_segments
assert remove_dot_segments('/a/b/c/../../../../') == '/'

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