pylupdate6 fails under Python 3.14

Marko Luther marko.luther at gmx.net
Fri Oct 31 09:53:07 GMT 2025


There seems to be a problem running pylupdate6 under Python 3.14

....
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ast.py", line 506, in visit
    return visitor(node)
  File "/Users/luther/Documents/Projects/Artisan/Repository/artisan/.venv14u/lib/python3.14/site-packages/PyQt6/lupdate/python_source.py", line 166, in visit_Call
    call_args = self._parse_translate(node)
  File "/Users/luther/Documents/Projects/Artisan/Repository/artisan/.venv14u/lib/python3.14/site-packages/PyQt6/lupdate/python_source.py", line 292, in _parse_translate
    name = self._get_first_str(node.args)
  File "/Users/luther/Documents/Projects/Artisan/Repository/artisan/.venv14u/lib/python3.14/site-packages/PyQt6/lupdate/python_source.py", line 207, in _get_first_str
    return cls._get_str(args[0])
           ~~~~~~~~~~~~^^^^^^^^^
  File "/Users/luther/Documents/Projects/Artisan/Repository/artisan/.venv14u/lib/python3.14/site-packages/PyQt6/lupdate/python_source.py", line 227, in _get_str
    if isinstance(node, ast.Str):
                        ^^^^^^^
AttributeError: module 'ast' has no attribute 'Str'


Seems that ast.Str was removed from Python3.14 and should be replaced by ast.Constant and attribute s by value. Thus I replaced the lines 

        if isinstance(node, ast.Str):
            return node.s

in python_source.py by

        if isinstance(node, ast.Constant):
            return node.value

and this seems to work.

This using the latest PyQt/Qt from pypip.

Best,
Marko


More information about the PyQt mailing list