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

extract_json_strings.py borked on optional bodyparts name #2978

Closed
scarf005 opened this issue Jun 20, 2023 · 1 comment · Fixed by #2979
Closed

extract_json_strings.py borked on optional bodyparts name #2978

scarf005 opened this issue Jun 20, 2023 · 1 comment · Fixed by #2979
Assignees
Labels

Comments

@scarf005
Copy link
Member

scarf005 commented Jun 20, 2023

Describe the bug

workflow

Run lang/update_pot.sh
> Extracting strings from json
==> Generating the list of all Git tracked files
==> Parsing JSON
----> Traversing directory data/help
----> Traversing directory data/json
Traceback (most recent call last):
  File "/home/runner/work/Cataclysm-BN/Cataclysm-BN/lang/extract_json_strings.py", line 1268, in <module>
    extract_all_from_dir(state, i)
  File "/home/runner/work/Cataclysm-BN/Cataclysm-BN/lang/extract_json_strings.py", line 1178, in extract_all_from_dir
    extract_all_from_file(state, full_name)
  File "/home/runner/work/Cataclysm-BN/Cataclysm-BN/lang/extract_json_strings.py", line 1200, in extract_all_from_file
    extract(state, jsonobject)
  File "/home/runner/work/Cataclysm-BN/Cataclysm-BN/lang/extract_json_strings.py", line 1001, in extract
    extract_specials[object_type](state, item)
  File "/home/runner/work/Cataclysm-BN/Cataclysm-BN/lang/extract_json_strings.py", line 231, in extract_bodypart
    writestr(state, item["heading_multiple"])
KeyError: 'heading_multiple'
Error in extract_json_strings.py. Aborting
Error: Process completed with exit code 1.

writestr(state, item["encumbrance_text"])
writestr(state, item["heading"])
writestr(state, item["heading_multiple"])

#2775 made bodypart names like heading_multiple optional, however extract_json_strings.py doesn't know that and it's been secretly failing for a month.

Steps To Reproduce

run lang/update_pot.sh from project root

Additional context

originally reported in discord by fruitybite

@scarf005 scarf005 added the bug label Jun 20, 2023
@scarf005 scarf005 changed the title translation templates arent pushed extract_json_strings.py borked after #2775 Jun 20, 2023
@scarf005 scarf005 changed the title extract_json_strings.py borked after #2775 extract_json_strings.py borked on optional bodyparts name Jun 20, 2023
@scarf005 scarf005 self-assigned this Jun 20, 2023
@scarf005
Copy link
Member Author

cc @KheirFerrum

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

Successfully merging a pull request may close this issue.

1 participant