How do I connect a bone to another bone via python script
Parenting is done in edit mode where you setup the armature.

arm.pose.bones already indicates it is related to posing bones.

Try:

arm.data.edit_bones['yourBone'].parent = arm.data.edit_bones['parentBone']