datastax / cstar_perf

Apache Cassandra performance testing platform
Apache License 2.0
72 stars 34 forks source link

moves string comparison into try block #123

Closed mambocab closed 8 years ago

mambocab commented 8 years ago

I've had a couple jobs fail from unicode decoding errors -- see the end of this console trace:

http://cstar.datastax.com/tests/artifacts/8af9ae48-7e79-11e5-8e7a-0256e416528f/console

I think this should work around the issue, though I don't have a local environment to test on.

nutbunnies commented 8 years ago

LGTM -- although I'm curious where the â is/coming from

mambocab commented 8 years ago

I've lost the link, but some SO post made me believe it's the first char-worth of a smart quote, which is a reasonable guess:

>>> '“'.decode('ascii')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)

Thanks for the review, merging.