EDMarketConnector icon indicating copy to clipboard operation
EDMarketConnector copied to clipboard

Python 3.9 error: TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Open chennin opened this issue 1 year ago • 2 comments

Running from source wiki currently states (Dec 18, 2023 revision) that EDMC "will no longer work under Python 3.8 or earlier". However, EDMC does not run on 3.9 either.

Traceback (most recent call last):
  File "/data/./EDMarketConnector.py", line 61, in <module>
    import killswitch
  File "/data/killswitch.py", line 20, in <module>
    import config
  File "/data/config/__init__.py", line 486, in <module>
    config = get_config()
  File "/data/config/__init__.py", line 480, in get_config
    from .linux import LinuxConfig
  File "/data/config/linux.py", line 17, in <module>
    class LinuxConfig(AbstractConfig):
  File "/data/config/linux.py", line 25, in LinuxConfig
    def __init__(self, filename: str | None = None) -> None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Repro'd by checking out the code and git checkout stable (tag: Release/5.10.1), then podman run -it --rm -v $PWD:/data python:3.9 bash, then in the container: cd /data; pip install -r requirements.txt; python ./EDMarketConnector.py.

Also reported on ED Community Discord.

str | None syntax was apparently added in 3.10, though I don't have a source other than StackOverflow.

chennin avatar Mar 06 '24 12:03 chennin