I have an string of pairs of characters representing hex numbers, (e.g. 0f means decimal 15).
I need this in binary format, so I called
binArray = binascii.unhexlify(finalString)
I have "bash on Ubuntu on Windows" installed, and when I perform this from there it works fine.
However, I need to invoke the script from a .bat file in the windows environment. When I call the exact same python program from the .bat file, if unhexlify sees '0a' in the hex string it converts it to 0d 0a (in the binary output). This is not a text file and the line-end conversion is corrupting my data!
Is there a way to convince unhexlify to stop doing this when I call it from the windows environment?
It would seem like a waste to have to roll-my-own conversion.