Skip to content

TypeError: a bytes-like object is required, not 'str' #28

@penultimatehoppopper

Description

@penultimatehoppopper

Trying to re-use some python 2 code in version 3 however hitting this snag (see attached code) any ideas?? Much appreciated!

--- connected to: 192.168.69.99
--- getting version information
Traceback (most recent call last):
File "/home/pi/Documents/prne/section6-CommunicatingWithNetworkDevices/show version-python3.py", line 83, in
device_version = get_version_info(session)
File "/home/pi/Documents/prne/section6-CommunicatingWithNetworkDevices/show version-python3.py", line 66, in get_version_info
version_output_parts = version_output_lines[1].split(',')
TypeError: a bytes-like object is required, not 'str'

sample code.txt

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