Skip to content

FileLocator.relative_filename() could mangle the path too much in some unlikely cases #194

@nedbat

Description

@nedbat

Originally reported by Marius Gedminas (Bitbucket: mgedmin, GitHub: mgedmin)


If your working directory is /src/myproject and you happen to have your source files in /src/myproject/branchname/src/myproject/foo.py, FileLocator().relative_filename() will strip both '/src/myproject/' substrings from the path, leaving just 'branchnamefoo.py'.

I'm attaching a test case and a fix.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions