galaxyproject / cargo-port

cache packages permanently
https://depot.galaxyproject.org/software/
MIT License
12 stars 34 forks source link

galaxy-package-locator fails (even on given example) #165

Closed bernt-matthias closed 4 years ago

bernt-matthias commented 4 years ago

./bin/galaxy-package-locator --package_id samtools --package_version "1.2"

INFO:root:Searching for package: samtools in https://depot.galaxyproject.org/software/urls.tsv
Traceback (most recent call last):
  File "./bin/galaxy-package-locator", line 58, in <module>
    get()
  File "/home/berntm/.venv3/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/berntm/.venv3/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/berntm/.venv3/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/berntm/.venv3/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "./bin/galaxy-package-locator", line 36, in get
    for ld in yield_packages(handle):
  File "/home/berntm/projects/cargo-port/cargoport/utils.py", line 18, in yield_packages
    if line.startswith('#'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Problem is that urllib opens with "rb", but if a file is given its "r".

I guess the best is to open always with "rb" and fix the startwith calls?

bgruening commented 4 years ago

Uh, python3 change? Sounds good to me. Are you going to work on this?

bernt-matthias commented 4 years ago

Can do.