Skip to content

Conversation

@agbuckley
Copy link
Collaborator

From Python 3.6 onwards, strings containing invalid escape sequences lead to noisy warnings, since these were previously passed through safely but now can be misinterpreted as generic Unicode escapes rather than specific C/Python string sequences.

We're getting a lot of these from the regex-heavy harvester machinery, and from Doxygen backslash escapes (these could be @ signs) in generated headers. It's more than a build-cleanliness issue, since these warnings are scheduled to become syntax errors in an upcoming Python 3.x release.

I've attempted to fix them, using mainly raw r"" strings. Let's see if the CI flags any issues with the generated output.

…ds, mainly by using proper raw strings where escapes are expected
@agbuckley
Copy link
Collaborator Author

Note that it's easier to view the diff with whitespace changes hidden, due to a lot of trailing spaces, particularly in the header generation. Click the settings cog in the GitHub "Files changed" tab.

@ChrisJChang
Copy link
Collaborator

Trying to build this locally fails. This seems to generate additional slashes that break the build. For example, in Models/src/particle_database.cpp:

#include \"gambit/Models/partmap.hpp\"
#include \"gambit/Models/particle_macros.hpp\"

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants