Skip to content

agw.py Strings no longer allowed in struct.pack #2

@SullivanChrisJ

Description

@SullivanChrisJ

When adding the call signs and payload to an AX.25 frame, the call to struct in the packed method of AGWFrame fails in the original Python 2 code when run in Python 3 as struct,pack no longer allows strings. To accommodate the change, the init and set_payload methods have been modified to convert the strings to byte objects. Other functions will need to be changed as well.

This may not be sufficient as it will remain to be seen how these functions are used. We may want to determine if a bytes (or bytearray) object is passed to set_payload and leave it alone, as encoding to ascii would probably fail. Adding UTF-8 encoding may benefit internationalization.

Examination of the modules using the AGWFrame objects will help determine the best solution.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions