### Describe the bug I'm attempting to read a configuration from `%APPDATA%\can.ini`, specifically this config from the documentation for the [PCAN Basic API](https://python-can.readthedocs.io/en/stable/interfaces/pcan.html): ``` [default] interface = pcan channel = PCAN_USBBUS1 state = can.bus.BusState.PASSIVE bitrate = 500000 ``` Rather than interpret the state config as an enum value, `python-can` seems to treat it as a string, so fails with: ``` ValueError: BusState must be Active or Passive ``` ### To Reproduce Try to instantiate `can.Bus()` with the above config in `%APPDATA%\can.ini`. ### Expected behavior `state = can.bus.BusState.PASSIVE` is interpreted as the enum value rather than the string 'can.bus.BusState.PASSIVE'. ### Additional context OS and version: Windows 11 Pro 24H2 Python version: 3.13.4 python-can version: 4.5.0 python-can interface/s (if applicable): PCAN Basic API
Activity
Convert BusState to enum when read with configparser (#1957)
Gregox273 commentedon Jul 22, 2025
Fixed by #1957