I've copied ping packet contents from WireShark analysis of captured packets - code had it as 192 letters Q, ping had it bit differently:
replace or insert after line 128
data = 192 * 'Q'
the correct definition of packet contents
data = 'e283030000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'.decode("hex")
and warnings went away.
But indeed I may want to look for cleaner implementation as José suggests.