Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings in generate_packets.py #2062

Closed
lmoureaux opened this issue Nov 27, 2023 · 0 comments · Fixed by #2070
Closed

Warnings in generate_packets.py #2062

lmoureaux opened this issue Nov 27, 2023 · 0 comments · Fixed by #2070
Labels
bug Something isn't working tools Issues related to mp, ruledit, etc along with CI and build tools.

Comments

@lmoureaux
Copy link
Contributor

Describe the bug
Python throws warnings when parsing generate_packets.py:

[228/509] Generating hand_gen.h, hand_gen.cpp
D:\a\freeciv21\freeciv21\common\generate_packets.py:131: SyntaxWarning: invalid escape sequence '\('
  mo = re.search("^(.*)\((.*)\)$", kind)
D:\a\freeciv21\freeciv21\common\generate_packets.py:136: SyntaxWarning: invalid escape sequence '\D'
  mo = re.search("^(\D+)(\d+)$", typeinfo["dataio_type"])
D:\a\freeciv21\freeciv21\common\generate_packets.py:191: SyntaxWarning: invalid escape sequence '\('
  mo = re.search("^add-cap\((.*)\)$", i)
D:\a\freeciv21\freeciv21\common\generate_packets.py:195: SyntaxWarning: invalid escape sequence '\('
  mo = re.search("^remove-cap\((.*)\)$", i)
D:\a\freeciv21\freeciv21\common\generate_packets.py:1077: SyntaxWarning: invalid escape sequence '\s'
  mo = re.search("^\s*(\S+)\s*=\s*(\d+)\s*;\s*(.*?)\s*$", lines[0])
D:\a\freeciv21\freeciv21\common\generate_packets.py:1159: SyntaxWarning: invalid escape sequence '\('
  mo = re.search("^cancel\((.*)\)$", i)
D:\a\freeciv21\freeciv21\common\generate_packets.py:1697: SyntaxWarning: invalid escape sequence '\s'
  lines = map(lambda x: re.sub("\s*#.*$", "", x), lines)
D:\a\freeciv21\freeciv21\common\generate_packets.py:1698: SyntaxWarning: invalid escape sequence '\s'
  lines = map(lambda x: re.sub("\s*//.*$", "", x), lines)
D:\a\freeciv21\freeciv21\common\generate_packets.py:1699: SyntaxWarning: invalid escape sequence '\s'
  lines = filter(lambda x: not re.search("^\s*$", x), lines)

To Reproduce
Steps to reproduce the behavior:

  1. Use a recent Python (3.12.0 for the example above)
  2. Build
  3. Look at the logs
  4. See warnings

Expected behavior
No warnings

Platform and version (please complete the following information):

Additional context
This script underwent some refactoring in the Freeciv repo.

@lmoureaux lmoureaux added bug Something isn't working tools Issues related to mp, ruledit, etc along with CI and build tools. labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tools Issues related to mp, ruledit, etc along with CI and build tools.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant