awscurl: PR #77 returns raw bytes as output, resulting output that is not parsable as json in current(0.19) release when using python 3

When using 0.19 awscurl with python 3, encoding response.text results in a byte object being returned. Printing that directly results in the output being prefixed with b' (see screenshots below), and thus json output cannot be parsed directly from the response. In Python 2 this is not an issue. I could also see this being an issue for (say) an xml based response as well (though I have not tested that).

My use case: I’m currently invoking awscurl in a unix pipe, where the result of awscurl is piped to jq for further processing (in CI); updating to the latest version broke the pipe. For the moment I’ve pinned the version in CI at 0.17

Python 3 screenshot

Screen Shot 2019-12-18 at 4 50 09 PM

Python 2 screenshot

Screen Shot 2019-12-18 at 4 50 47 PM

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 11
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Fixed in version 0.21 - thank you @okigan!