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

TypeError: write() argument must be str, not bytes when running maf_build_index.py with python3.6 #47

Closed
mt1022 opened this issue Aug 28, 2019 · 2 comments

Comments

@mt1022
Copy link

mt1022 commented Aug 28, 2019

I have latest release of bx-python (0.8.4) installed and came across the following error when index a small maf file using python 3.6:

Traceback (most recent call last):
  File "/home/mt1022/anaconda3/bin/maf_build_index.py", line 88, in <module>
    if __name__ == "__main__": main()
  File "/home/mt1022/anaconda3/bin/maf_build_index.py", line 85, in main
    indexes.write( out )
  File "/home/mt1022/anaconda3/lib/python3.6/site-packages/bx/interval_index_file.py", line 324, in write
    write_packed( f, ">3I", MAGIC, VERSION, len( self.indexes ) )
  File "/home/mt1022/anaconda3/lib/python3.6/site-packages/bx/interval_index_file.py", line 463, in write_packed
    f.write( pack( pattern, *vals ) )
TypeError: write() argument must be str, not bytes

The same file can be indexed successfully with python2.7. Could you help investigate what is causing the error?

@mirahan
Copy link

mirahan commented Nov 20, 2019

We are having the same issue with the conda version on python 3.6.
bx-python 0.8.5 py36h9449cc1_0 bioconda

@mt1022
Copy link
Author

mt1022 commented Nov 20, 2019

@mirahan , I finally used AlignIO.MafIO from biopython (version 1.73) instead. I find it works fine in python3 with even large MAF files such as that for the human genome against 99 vertebrates..

nsoranzo added a commit that referenced this issue Nov 20, 2019
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