Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Conversation

MichaelSchuldes
Copy link

Summary

When generating the python code from protobuf, backslashes in the comments are replaced with double backslashes to prevent UnkownEscapeSequence warnings. E.g., this fixed this library for proto files from https://github.com/OpenSimulationInterface/open-simulation-interface/blob/master/osi_featuredata.proto .

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
    • This change has an associated test.
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@AdrienVannson
Copy link
Contributor

AdrienVannson commented Mar 6, 2025

Thank you for the PR!

Indeed, this is a useful change. Can you fix the code quality check? I can merge afterwards. If you want you can also add a small test to check that the generated docstring is the one expected (I can also do it later).

I think it would also be useful to add something like .replace('"', '\"') since triple quotes can also break comments.

@AdrienVannson
Copy link
Contributor

This is fixed in 0.3.2, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants