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 in bioservices/uniprot.py #254

Open
chagas98 opened this issue Mar 31, 2023 · 1 comment
Open

Error in bioservices/uniprot.py #254

chagas98 opened this issue Mar 31, 2023 · 1 comment

Comments

@chagas98
Copy link

I got an error from bioservices when it was running the cazy_webscraper application. I opened an issue there.

File "/usr/local/lib/python3.10/dist-packages/bioservices/uniprot.py", line 744, in search
    batch = batch.split("\n")[1:]
AttributeError: 'int' object has no attribute 'split'` 

The error arose when I tried to get some data from UniProt. It seems that batch = self.services.http_get(link, frmt="txt") returns an integer instead of a string. When I forced the process with str(batch), I got a warning message, but I could have access to the data.

WARNING [bioservices.UniProt:596]:  status is not ok with Forbidden 

However, it was not a good practice, which led me to come and check this issue. Any thoughts?

Thanks in advance.

@cokelaer
Copy link
Owner

cokelaer commented Jun 2, 2023

If an integer is returned, it may be the error code from the web service itself (e.g. 404). I should add a try/except but meanwhile, I believe, you may do it in your code instead of str(batch) since str(batch) will work (if your output is the error code 404). Maybe the service was down when you try, or you request is wrong. Could you provide a working exmaple ? thanks

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