Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bytes/text confusion with response objects #762

Merged
merged 1 commit into from
Mar 26, 2018
Merged

Fix bytes/text confusion with response objects #762

merged 1 commit into from
Mar 26, 2018

Conversation

jdufresne
Copy link
Contributor

@jdufresne jdufresne commented Mar 25, 2018

response.content is a byte string. It should be compared against other byte strings. To examine the response content as text, use the response.text attribute.

Fixes warnings when Python is passed the -b argument (Issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str.)

BytesWarning: str() on a bytes instance

For additional information on the -b argument, see:

https://docs.python.org/3/using/cmdline.html#cmdoption-b

For additional information on response.text, see:

http://docs.python-requests.org/en/master/api/#requests.Response.text

response.content is a byte string. It should be compared against other
byte strings. To examine the response content as text, use the
response.text attribute.

Fixes warnings when Python is passed the -b argument (Issue warnings
about str(bytes_instance), str(bytearray_instance) and comparing
bytes/bytearray with str.)

  BytesWarning: str() on a bytes instance

For additional information on the -b argument, see:

https://docs.python.org/3/using/cmdline.html#cmdoption-b

For additional information on response.text, see:

http://docs.python-requests.org/en/master/api/#requests.Response.text
@codecov
Copy link

codecov bot commented Mar 25, 2018

Codecov Report

Merging #762 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #762   +/-   ##
=======================================
  Coverage   65.13%   65.13%           
=======================================
  Files          14       14           
  Lines        1417     1417           
  Branches      222      222           
=======================================
  Hits          923      923           
  Misses        443      443           
  Partials       51       51
Impacted Files Coverage Δ
locust/clients.py 89.88% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa741c9...caff313. Read the comment docs.

@cgoldberg cgoldberg merged commit fcd9fe7 into locustio:master Mar 26, 2018
@cgoldberg
Copy link
Member

thanks!

@cgoldberg cgoldberg added this to the 0.9.0 milestone Apr 24, 2018
@jdufresne jdufresne deleted the bytes branch October 19, 2019 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants