Skip to content

Library and example2.py is not compatible with Python 3 #34

Description

@jeffsf

On a machine where Python 3 is now default and Python 2 is not installed (Debian and Ubuntu, for example), example2.py fails to run.

So far:

  • Python 2 print in example2.py, rather than print()
  • TypeError in "stuff"
Traceback (most recent call last):
  File "/home/jeff/devel/tsip/example2.py", line 58, in <module>
    gps_conn.write(tsip.Packet(0x35, 0b00110011, 0b00000011, 0b00000001, 0b00101001))
  File "/home/jeff/venv/tsip/lib/python3.5/site-packages/tsip/hlapi.py", line 178, in write
    super(GPS, self).write(frame(stuff(packet.pack())))
  File "/home/jeff/venv/tsip/lib/python3.5/site-packages/tsip/llapi.py", line 72, in stuff
    return packet.replace(CHR_DLE, CHR_DLE + CHR_DLE)
TypeError: a bytes-like object is required, not 'str'

apparently from config.py which declares those variables as strings.

Python 3.5.3

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