remram44 / pybabel-godot

Plugin for Babel to support Godot scene files (.tscn)
Other
14 stars 11 forks source link

pybabel 2.14.0 and newer reports "Unknown extraction method" error #17

Open Poobslag opened 5 days ago

Poobslag commented 5 days ago

The plugin reports an error running with pybabel 2.14.0 or newer:

extracting messages from project\assets\main\locale\localizables-extracted.py (encoding="utf-8")
extracting messages from project\assets\main\locale\localizables-scancodes.py (encoding="utf-8")
extracting messages from project\src\main\career\CareerMap.tscn (encoding="utf-8")
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python312\Scripts\pybabel.exe\__main__.py", line 7, in <module>
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python312\Lib\site-packages\babel\messages\frontend.py", line 979, in main
    return CommandLineInterface().run(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python312\Lib\site-packages\babel\messages\frontend.py", line 905, in run
    return cmdinst.run()
           ^^^^^^^^^^^^^
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python312\Lib\site-packages\babel\messages\frontend.py", line 516, in run
    for filename, lineno, message, comments, context in extracted:
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python312\Lib\site-packages\babel\messages\extract.py", line 215, in extract_from_dir
    yield from check_and_call_extract_file(
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python312\Lib\site-packages\babel\messages\extract.py", line 279, in check_and_call_extract_file
    for message_tuple in extract_from_file(
                         ^^^^^^^^^^^^^^^^^^
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python312\Lib\site-packages\babel\messages\extract.py", line 321, in extract_from_file
    return list(extract(method, fileobj, keywords, comment_tags,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aaron\AppData\Local\Programs\Python\Python312\Lib\site-packages\babel\messages\extract.py", line 445, in extract
    raise ValueError(f"Unknown extraction method {method!r}")
ValueError: Unknown extraction method 'godot_scene'
. done.
. done.

Downgrading to pybabel 2.13.1 fixes the error.

remram44 commented 5 days ago

Thanks for reporting!

https://github.com/python-babel/babel/pull/1041 is the likely culprit. This might take a little time.