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.
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.