Sergix / keypirinha-stackoverflow

Keypirinha plugin for StackOverflow searching.
GNU General Public License v3.0
2 stars 1 forks source link

No result if search term has space or special character in it #1

Closed ueffel closed 3 years ago

ueffel commented 5 years ago

I'm getting an error if I search for example "python dict" (or any search term with a space in it)

20:10:14.246 ** ERROR: StackOverflow.StackOverflow: Could not send request:  HTTP Error 400: Bad request
20:10:14.247 ** ERROR: Error from StackOverflow.StackOverflow.on_suggest: <class 'UnboundLocalError'>: local variable 'response' referenced before assignment
Traceback (most recent call last):
  File "C:\Users\ueffel\AppData\Roaming\Keypirinha\InstalledPackages\StackOverflow.keypirinha-package\stackoverflow.py", line 50, in on_suggest
  File "C:\Users\ueffel\AppData\Roaming\Keypirinha\InstalledPackages\StackOverflow.keypirinha-package\stackoverflow.py", line 68, in get_query

As I am a developer myself, a few implementation hints:

Edit: Oh yeah a and you don't need the keypirinha-package file as committed file. The keypirinha-package in the release section is sufficient.

Sergix commented 5 years ago

Thanks for the input! I'll look at fixing these within the next couple days.

verajosemanuel commented 3 years ago

same error here. Not working when multiword search.

18:10:39.972 StackOverflow.StackOverflow: multiline rstudio
18:10:39.987 ** ERROR: StackOverflow.StackOverflow: Could not send request:  URL can't contain control characters. '/2.2/search?site=stackoverflow&order=desc&sort=activity&pagesize=10&intitle=multiline rs' (found at least ' ')
18:10:39.987 ** ERROR: Error from StackOverflow.StackOverflow.on_suggest: <class 'UnboundLocalError'>: local variable 'response' referenced before assignment
Traceback (most recent call last):
  File "C:\Users\joe\Programs\Keypirinha\portable\Profile\InstalledPackages\StackOverflow.keypirinha-package\stackoverflow.py", line 50, in on_suggest
  File "C:\Users\joe\Programs\Keypirinha\portable\Profile\InstalledPackages\StackOverflow.keypirinha-package\stackoverflow.py", line 68, in get_query
Sergix commented 3 years ago

It's been a while since I've worked on this plugin haha, but thanks for the input. I'm going to merge the open PR since it contains some essential fixes and we can work on any further issues from there.