OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
853 stars 311 forks source link

[Bug] Error when launching GUI on Fedora 41 #4651

Closed cedricr closed 3 weeks ago

cedricr commented 3 weeks ago

Describe the bug

When launching the GUI on Fedora 41, I get the following errors in the GUI console before doing anything:

Exception in thread
Thread-1
:
Traceback (most recent call last):
  File "/usr/lib64/python3.13/threading.py", line 1041, in
_bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/usr/local/grass85/gui/wxpython/core/gthread.py",
line 149, in __run
    self.__run_backup()
    ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/grass85/gui/wxpython/core/gthread.py",
line 103, in run
    onterminate=vars()["onterminate"],
                ~~~~~~^^^^^^^^^^^^^^^
KeyError: 'onterminate'
Exception in thread
Thread-3
:
Traceback (most recent call last):
  File "/usr/lib64/python3.13/threading.py", line 1041, in
_bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/usr/local/grass85/gui/wxpython/core/gthread.py",
line 149, in __run
    self.__run_backup()
    ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/grass85/gui/wxpython/core/gthread.py",
line 103, in run
    onterminate=vars()["onterminate"],
                ~~~~~~^^^^^^^^^^^^^^^
KeyError: 'onterminate'

If I swich to the Python tab, I can see that I have a working interpreter.

Typing vars()["onterminate"] there gives the same result:

>>> vars()["onterminate"]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
KeyError: 'onterminate'

And here’s the full result of vars():

vars()
{'gs': <module 'grass.script' from '/usr/local/grass85/etc/python/grass/script/__init__.py'>, 'AddLayer': <bound method PyShellWindow.AddLayer of <lmgr.pyshell.PyShellWindow object at 0x7f2ed4c915b0>>, 'help': <bound method PyShellWindow.Help of <lmgr.pyshell.PyShellWindow object at 0x7f2ed4c915b0>>, 'shell': <wx.py.shell.ShellFacade object at 0x7f2ee2f36ba0>, '__builtins__': {'__name__': 'builtins', '__doc__': "Built-in functions, types, exceptions, and other objects.\n\nThis module provides direct access to all 'built-in'\nidentifiers of Python; for example, builtins.len is\nthe full name for the built-in function len().\n\nThis module is not normally accessed explicitly by most\napplications, but can be useful in modules that provide\nobjects with the same name as a built-in value, but in\nwhich the built-in of that name is also needed.", '__package__': '', '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'), '__build_class__': <built-in function __build_class__>, '__import__': <built-in function __import__>, 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'aiter': <built-in function aiter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'anext': <built-in function anext>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, '__debug__': True, 'BaseException': <class 'BaseException'>, 'BaseExceptionGroup': <class 'BaseExceptionGroup'>, 'Exception': <class 'Exception'>, 'GeneratorExit': <class 'GeneratorExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'SystemExit': <class 'SystemExit'>, 'ArithmeticError': <class 'ArithmeticError'>, 'AssertionError': <class 'AssertionError'>, 'AttributeError': <class 'AttributeError'>, 'BufferError': <class 'BufferError'>, 'EOFError': <class 'EOFError'>, 'ImportError': <class 'ImportError'>, 'LookupError': <class 'LookupError'>, 'MemoryError': <class 'MemoryError'>, 'NameError': <class 'NameError'>, 'OSError': <class 'OSError'>, 'ReferenceError': <class 'ReferenceError'>, 'RuntimeError': <class 'RuntimeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'SyntaxError': <class 'SyntaxError'>, 'SystemError': <class 'SystemError'>, 'TypeError': <class 'TypeError'>, 'ValueError': <class 'ValueError'>, 'Warning': <class 'Warning'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'BytesWarning': <class 'BytesWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'EncodingWarning': <class 'EncodingWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'UserWarning': <class 'UserWarning'>, 'BlockingIOError': <class 'BlockingIOError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionError': <class 'ConnectionError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'InterruptedError': <class 'InterruptedError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'IndentationError': <class 'IndentationError'>, '_IncompleteInputError': <class '_IncompleteInputError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'PythonFinalizationError': <class 'PythonFinalizationError'>, 'RecursionError': <class 'RecursionError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'UnicodeError': <class 'UnicodeError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'TabError': <class 'TabError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'ExceptionGroup': <class 'ExceptionGroup'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'open': <built-in function open>, 'quit': 'Click on the close button to leave the application.', 'exit': 'Click on the close button to leave the application.', 'copyright': Copyright (c) 2001-2024 Python Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'credits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object., '_': <function _translate at 0x7f2ee2d65260>, 'raw_input': <bound method Shell.raw_input of <wx.py.shell.Shell object at 0x7f2ed4c91400>>, 'close': 'Click on the close button to leave the application.', 'cd': <function cd at 0x7f2dadf0efc0>, 'ls': <function ls at 0x7f2dadf0f060>, 'pwd': <function pwd at 0x7f2dadf0ef20>, 'sx': <function sx at 0x7f2dadf0f100>}}

The UI itself is functionnal, I can open menus, etc. The mouse pointer stays "busy" though.

Thanks for your help ! If I try to run any command from the UI though (for ex. Settings > Computational Region > Show current region), nothing happens except for a new error being displayed in the console:

Exception in thread
Thread-2
:
Traceback (most recent call last):
  File "/usr/lib64/python3.13/threading.py", line 1041, in
_bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/usr/local/grass85/gui/wxpython/core/gconsole.py",
line 138, in run
    if not vars()["callable"]:
           ~~~~~~^^^^^^^^^^^^
KeyError: 'callable'

I initially thought about a packaging error (I was testing with the grass installed via dnf install grass-gui), so I recompiled grass from source, but get the exact same errors (the results pasted above come from the recompiled version).

System description

OS: Fedora 41

echoix commented 3 weeks ago

It's the first Python 3.13 bug we got filed. It's the only thing that stands out for me in the two system configurations. (For 8.4.0, Python 3.13 didn't exist yet)

cedricr commented 3 weeks ago

You’re right. I’ve managed to get Python 3.12/wxWidgets working on my system and now the gui works as expected. Should I rename the issue?

cedricr commented 3 weeks ago

Thanks a lot, that was an impressive resolution time!