Skip to content

Commit

Permalink
force bytes to str
Browse files Browse the repository at this point in the history
  • Loading branch information
esheldon committed Aug 20, 2024
1 parent 3e937f9 commit 8e52381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion fitsio/fitslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,10 @@ def get_dither_seed(dither_seed):
1-10_000:
use the input seed
"""
if isinstance(dither_seed, (str, bytes)):
if isinstance(dither_seed, bytes):
dither_seed = str(dither_seed, 'utf-8')

if isinstance(dither_seed, str):
dlow = dither_seed.lower()
if dlow == 'clock':
seed_out = 0
Expand Down
2 changes: 1 addition & 1 deletion fitsio/tests/test_image_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def test_compressed_seed(compress, seed_type, use_fits_object, dtype):
dither_seed2 = 4
elif seed_type == 'checksum':
dither_seed1 = 'checksum'
dither_seed2 = 'checksum'
dither_seed2 = b'checksum'
elif seed_type == 'checksum_int':
dither_seed1 = -1
# any negative means use checksum
Expand Down

0 comments on commit 8e52381

Please sign in to comment.