Skip to content

enumerations break on spaces #23

Description

@smee

Shouldn't

parts = line.split()
be splitlines? split will split on any whitespace, so this enumeration will not work:

:example 0=ok 1=not ok

Error message:

Traceback (most recent call last):
File "/home/pi/.local/bin/modbus", line 110, in
main()
File "/home/pi/.local/bin/modbus", line 101, in main
definitions.parse(args.registers + os.environ.get('MODBUS_DEFINITIONS', '').split(':'))
File "/home/pi/.local/lib/python3.9/site-packages/modbus_cli/definitions.py", line 25, in parse
self.parse_line(accumulated_line)
File "/home/pi/.local/lib/python3.9/site-packages/modbus_cli/definitions.py", line 40, in parse_line
name, values = self.parse_presenter(line)
File "/home/pi/.local/lib/python3.9/site-packages/modbus_cli/definitions.py", line 63, in parse_presenter
value, symbol = definition.split('=')
ValueError: not enough values to unpack (expected 2, got 1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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