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

app crashes after running search_tags #75

Closed
manu-g opened this issue Aug 29, 2016 · 4 comments
Closed

app crashes after running search_tags #75

manu-g opened this issue Aug 29, 2016 · 4 comments

Comments

@manu-g
Copy link

manu-g commented Aug 29, 2016

Orochi crashes by running the search_tags command under python3.5 and python2.7 under debian.

`(8tracks)> search_tags rock
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/requests/utils.py", line 796, in check_header_validity
if not pat.match(value):
TypeError: expected string or bytes-like object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/orochi", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/orochi/client.py", line 862, in main
client.cmdloop()
File "/usr/local/lib/python3.5/dist-packages/orochi/client.py", line 216, in cmdloop
super(Client, self).cmdloop()
File "/usr/lib/python3.5/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python3.5/cmd.py", line 217, in onecmd
return func(arg)
File "/usr/local/lib/python3.5/dist-packages/orochi/client.py", line 268, in do_search_tags
mixes = self.search_request(s, 'tag')
File "/usr/local/lib/python3.5/dist-packages/orochi/client.py", line 500, in search_request
self.config['results_sorting'], self._search_results_page, self._results_per_page)
File "/usr/local/lib/python3.5/dist-packages/orochi/api.py", line 176, in search_mix
data = self._get(resource, params)
File "/usr/local/lib/python3.5/dist-packages/orochi/api.py", line 60, in _get
r = self.s.get(self.base_url + resource, params=params, *_kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 488, in get
return self.request('GET', url, *_kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 461, in request
prep = self.prepare_request(req)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 394, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 295, in prepare
self.prepare_headers(headers)
File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 409, in prepare_headers
check_header_validity(header)
File "/usr/local/lib/python3.5/dist-packages/requests/utils.py", line 800, in check_header_validity
"not %s" % (value, type(value)))
requests.exceptions.InvalidHeader: Header value 2 must be of type str or bytes, not <class 'int'>
`

@MisterFruits
Copy link

MisterFruits commented Sep 2, 2016

Hello,
I stumbled upon the same bug, it is related to the requests librairie: https://github.com/kennethreitz/requests/issues/3477. This is not a bug according to them so it wont be fixed.
I looked quickly on the code but I couldn't find where an integer were passed to requests args.
One workaround would be to downgrade the requests librairie to the version 2.10.0

pip uninstall requests
pip install requests==2.10.0

dbrgn added a commit that referenced this issue Sep 2, 2016
@dbrgn
Copy link
Owner

dbrgn commented Sep 2, 2016

Thanks @MisterFruits for the analysis, that helps a lot :)

I pushed a potential fix, could you test current master?

@MisterFruits
Copy link

It's working for me now after a

pip install -U git+https://github.com/dbrgn/orochi.git
[...]
Successfully installed orochi-0.2.1.dev0 requests-2.11.1

@dbrgn
Copy link
Owner

dbrgn commented Sep 2, 2016

Great. I released version 0.2.1 with a fix. https://pypi.python.org/pypi/orochi

@dbrgn dbrgn closed this as completed Sep 2, 2016
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

3 participants