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

pickle.UnpicklingError: the STRING opcode argument must be quoted #459

Closed
jabir366 opened this issue Mar 25, 2022 · 4 comments
Closed

pickle.UnpicklingError: the STRING opcode argument must be quoted #459

jabir366 opened this issue Mar 25, 2022 · 4 comments
Labels

Comments

@jabir366
Copy link

jabir366 commented Mar 25, 2022

What happened:

While querrying using howdoi, the program crashed . the query i used is howdoi get current branch git

What you expected to happen:

A simple one lined answer for my obvious query

Output with --explain

$ howdoi YOUR_COMMAND --explain
root@jjabir ~/j/bb# howdoi get current branch git --explain
INFO: Version: 2.0.19
INFO: Fetching answers for query: get current branch git
INFO: Searching google with URL: https://www.google.com/search?q=site:stackoverflow.com%20get%20current%20branch%20git&hl=en
Traceback (most recent call last):
  File "/usr/local/bin/howdoi", line 11, in <module>
    sys.exit(command_line_runner())
  File "/usr/local/lib/python3.6/dist-packages/howdoi/howdoi.py", line 815, in command_line_runner
    utf8_result = howdoi(args).encode('utf-8', 'ignore')
  File "/usr/local/lib/python3.6/dist-packages/howdoi/howdoi.py", line 633, in howdoi
    res = _get_answers(args)
  File "/usr/local/lib/python3.6/dist-packages/howdoi/howdoi.py", line 433, in _get_answers
    question_links = _get_links_with_cache(args['query'])
  File "/usr/local/lib/python3.6/dist-packages/howdoi/howdoi.py", line 417, in _get_links_with_cache
    cache.set(cache_key, question_links or CACHE_EMPTY_VAL)
  File "/usr/local/lib/python3.6/dist-packages/cachelib/file.py", line 215, in set
    self._prune()
  File "/usr/local/lib/python3.6/dist-packages/cachelib/file.py", line 152, in _prune
    self._remove_expired(now)
  File "/usr/local/lib/python3.6/dist-packages/cachelib/file.py", line 99, in _remove_expired
    expires = pickle.load(f)
_pickle.UnpicklingError: the STRING opcode argument must be quoted
@jabir366 jabir366 added the bug label Mar 25, 2022
@jabir366
Copy link
Author

I would like to contribute to fixing this issue

@gleitz
Copy link
Owner

gleitz commented Mar 27, 2022

Looks interesting. Any idea why you think it's happening?

@mbuhidar
Copy link

mbuhidar commented May 7, 2022

I had the same error after upgrading to Python 3.10. Clearing the cache using howdoi -C fixed it for me.
Great tool btw - thank you!

@gleitz
Copy link
Owner

gleitz commented May 13, 2022

@jabir366 one solution here would be to catch that error and to offer a message suggesting the user clear the cache.

@gleitz gleitz closed this as completed Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants