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

scene.resample(cache_dir=) fails with TypeError: Unicode-objects must be encoded before hashing #236

Closed
howff opened this issue Mar 20, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@howff
Copy link

howff commented Mar 20, 2018

Code Sample, a minimal, complete, and verifiable piece of code

local_scene = global_scene.resample(opt_mapping, nprocs=num_threads, resampler=opt_resampler, cache_dir="/var/tmp") 

Problem description

TypeError: Unicode-objects must be encoded before hashing

Actual Result, Traceback if applicable

    local_scene = global_scene.resample(opt_mapping, nprocs=num_threads, resampler=opt_resampler, cache_dir="/var/tmp") 
  File "lib/python3.4/site-packages/satpy/scene.py", line 596, in resample
    **resample_kwargs)
  File "lib/python3.4/site-packages/satpy/dataset.py", line 572, in resample
    new_data = resample(source_area, data, destination_area, **kwargs)
  File "lib/python3.4/site-packages/satpy/resample.py", line 521, in resample
    return resampler.resample(data, **kwargs)
  File "lib/python3.4/site-packages/satpy/resample.py", line 173, in resample
    cache_id = self.precompute(cache_dir=cache_dir, **kwargs)
  File "lib/python3.4/site-packages/satpy/resample.py", line 250, in precompute
    filename = self._create_cache_filename(cache_dir, kd_hash)
  File "lib/python3.4/site-packages/satpy/resample.py", line 186, in _create_cache_filename
    cache_dir, hashlib.sha1(hash_str).hexdigest() + ".npz")
TypeError: Unicode-objects must be encoded before hashing

Versions of Python, package at hand and relevant dependencies

python 3.4
satpy master

@mraspaud mraspaud added this to the v0.9 milestone Apr 24, 2018
@mraspaud mraspaud self-assigned this Apr 24, 2018
@mraspaud mraspaud added the bug label Apr 24, 2018
@mraspaud
Copy link
Member

I think this is fixed now in master. Feel free to reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants