This is probably the first thing I should have thought of when there's a difference between Nix and Windows environments:
Always check the EOL chars!
The problem was that when grabbing the username, password, etc. from my credentials file, I was stripping the newline character using string.rstrip('\n')
, so in the Unix environment that was leaving an \r
carriage return character behind which was then being passed as part of the POST
request.
The simple and correct solution which works in both environments is to use string.rstrip()
which strips all trailing whitespace and end of line chars.