VCF-kit icon indicating copy to clipboard operation
VCF-kit copied to clipboard

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

Open laura-bankers opened this issue 4 years ago • 1 comments

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'

laura-bankers avatar Jun 07 '21 14:06 laura-bankers

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.

tdido avatar Jun 08 '21 09:06 tdido