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

error while using docker image (andersenlab/vcf-kit:20200822175018b7b60d: TypeError: a bytes-like object is required, not 'str' #39

Open
laura-bankers opened this issue Jun 7, 2021 · 1 comment

Comments

@laura-bankers
Copy link

Hello - I am receiving the following error using the latest docker image (andersenlab/vcf-kit:20200822175018b7b60d). Any idea what this means or what I need to do to fix it? Any help you can provide is much appreciated.

Error:
Traceback (most recent call last):
File "/opt/conda/envs/vcf-kit/lib/python3.7/site-packages/vcfkit/vcf2tsv.py", line 89, in
line = line.replace("u'","") # No idea why u' is prefixed...
TypeError: a bytes-like object is required, not 'str'

@tdido
Copy link

tdido commented Jun 8, 2021

Seems like an encoding problem (also evidenced by the "u" prefix that the developer mentions).

A quick fix would be to decode the string by replacing:
line = line.replace("u'","")
with
line = line.decode().replace("u'","")
in the file /opt/conda/envs/vcf-kit/lib/python3.7/site-packages/vcfkit/vcf2tsv.py.

Bear in mind that this change will likely not survive updates to the docker image or conda environment.

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

2 participants