The _socket gets removed in either of two cases:
- after calling traci.close()
- after receiving a FatalTraCIError "connection closed by SUMO" which can
happen if the input data to sumo is faulty or sumo has crashed
If it happens to be the latter with the latest sumo release (1.7.0), please
try to boil down your code to a simple test case and provide the necessary
files for reproducing the crash.


Am Di., 15. Sept. 2020 um 00:53 Uhr schrieb Hariqi <[email protected]>:

> Hello SUMO users,
>
> I keep getting the socket error below from TraCI even though it works
> perfectly.
> I am running TraCI using python through pycharm. I am using it to get  a
> vehicle position repeatedly for optimization purposes.
> I am wondering if there is a way to fix it?
>
> Thanks.
>
> Traceback (most recent call last):
> File "C:/Users/ca0.py", line 72, in <module>
>     run()
>   File "C:/Users/ca0.py", line 48, in run
>     disp = traci.vehicle.getDistance('1')
>   File "C:\Program Files (x86)\Eclipse\Sumo\tools\traci\_vehicle.py", line
> 860, in getDistance
>     return self._getUniversal(tc.VAR_DISTANCE, vehID)
>   File "C:\Program Files (x86)\Eclipse\Sumo\tools\traci\domain.py", line
> 117, in _getUniversal
>     result = self._connection._sendReadOneStringCmd(self._cmdGetID, varID,
> objectID)
>   File "C:\Program Files (x86)\Eclipse\Sumo\tools\traci\connection.py",
> line 130, in _sendReadOneStringCmd
>     return self._checkResult(cmdID, varID, objID)
>   File "C:\Program Files (x86)\Eclipse\Sumo\tools\traci\connection.py",
> line 158, in _checkResult
>     result = self._sendExact()
>   File "C:\Program Files (x86)\Eclipse\Sumo\tools\traci\connection.py",
> line 96, in _sendExact
>     self._socket.send(length + self._string)
> AttributeError: 'Connection' object has no attribute '_socket'
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to