Skip to content

AttributeError: 'SimInfoAPI' object has no attribute '_rf2_tele' #9

@thoraxe

Description

@thoraxe
python ./sharedMemoryAPI.py

Traceback (most recent call last):
  File "./sharedMemoryAPI.py", line 336, in <module>
    test_main()
  File "./sharedMemoryAPI.py", line 236, in test_main
    info = SimInfoAPI()
  File "./sharedMemoryAPI.py", line 30, in __init__
    rF2data.SimInfo.__init__(self)
  File "/home/thoraxe/Red_Hat/openshift/pyRfactor2SharedMemory/rF2data.py", line 697, in __init__
    self._rf2_tele = mmap.mmap(0, ctypes.sizeof(rF2Telemetry), "$rFactor2SMMP_Telemetry$")
TypeError: an integer is required (got type str)
Exception ignored in: <function SimInfoAPI.__del__ at 0x7fce248744d0>
Traceback (most recent call last):
  File "./sharedMemoryAPI.py", line 211, in __del__
    self.close()
  File "./sharedMemoryAPI.py", line 204, in close
    self._rf2_tele.close()
AttributeError: 'SimInfoAPI' object has no attribute '_rf2_tele'

Similarly:

python rF2data.py 
Traceback (most recent call last):
  File "rF2data.py", line 718, in <module>
    info = SimInfo()
  File "rF2data.py", line 697, in __init__
    self._rf2_tele = mmap.mmap(0, ctypes.sizeof(rF2Telemetry), "$rFactor2SMMP_Telemetry$")
TypeError: an integer is required (got type str)
Exception ignored in: <function SimInfo.__del__ at 0x7f17ee8c2cb0>
Traceback (most recent call last):
  File "rF2data.py", line 714, in __del__
    self.close()
  File "rF2data.py", line 707, in close
    self._rf2_tele.close()
AttributeError: 'SimInfo' object has no attribute '_rf2_tele'

It's not clear why or what's wrong.

python --version
Python 3.7.16

pip list
Package           Version
----------------- -------
astroid           2.2.5  
behave            1.2.6  
colorama          0.4.1  
isort             4.3.21 
lazy-object-proxy 1.4.2  
mccabe            0.6.1  
parse             1.12.0 
parse-type        0.4.2  
pip               10.0.1 
psutil            5.7.0  
pylint            2.3.1  
setuptools        39.0.1 
six               1.12.0 
typed-ast         1.4.0  
wrapt             1.11.2 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions