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

str encoding error with aegea-build-image-for-mission #38

Open
jamestwebber opened this issue May 9, 2018 · 0 comments
Open

str encoding error with aegea-build-image-for-mission #38

jamestwebber opened this issue May 9, 2018 · 0 comments

Comments

@jamestwebber
Copy link

Might just be a python 2 vs 3 problem:

➜  Desktop aegea-build-image-for-mission demuxer demuxer
Traceback (most recent call last):
  File "/Users/james.webber/anaconda3/bin/aegea", line 23, in <module>
    aegea.main()
  File "/Users/james.webber/anaconda3/lib/python3.6/site-packages/aegea/__init__.py", line 76, in main
    result = parsed_args.entry_point(parsed_args)
  File "/Users/james.webber/anaconda3/lib/python3.6/site-packages/aegea/build_docker_image.py", line 94, in build_docker_image
    exec_fh.write(build_docker_image_shellcode % (encode_dockerfile(args), ))
TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
Traceback (most recent call last):
  File "/Users/james.webber/anaconda3/bin/aegea-build-image-for-mission", line 42, in <module>
    env=dict(os.environ, AEGEA_CONFIG_FILE=os.path.join(mission_wd, "config.yml"))
  File "/Users/james.webber/anaconda3/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['aegea', 'build_docker_image', 'demuxer', '--tags', 'AegeaMission=demuxer']' returned non-zero exit status 1.

I was able to fix it by just encoding the input to line 94, but that seems brittle:

exec_fh.write((build_docker_image_shellcode % (encode_dockerfile(args), )).encode())
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

No branches or pull requests

1 participant