tests: open attachment file in 'rb' mode, take into account 'true division' of ints in python 3