Skip to content

fix: fullyQualifiedName is wrong for Windows paths (backslashes not converted) #111

Closed

Description

@jimisola

What happened?

DecoratorProcessor.get_functions_and_classes builds fullyQualifiedName with str(file_path).replace("/", "."). On Windows, os.walk + os.path.join produce backslash paths (src\pkg\mod.py), so nothing is replaced and the generated annotations.yml contains names like src\pkg\mod.MyClass.method instead of src.pkg.mod.MyClass.method. reqstool-client then can't match annotations to code, with no error.

Expected behaviour

The same annotations.yml on Windows, macOS and Linux for the same sources.

Proposed fix

Normalise with PurePath(file_path).as_posix() before replacing / with ., plus a test with Windows-style paths.

Context

Found while smoke-testing reqstool on Windows (reqstool/reqstool-client#457), next to the encoding crash fixed in #109 / #110.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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