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

403 forbiddeb #492

Open
intrepidsilence opened this issue Feb 17, 2024 · 2 comments
Open

403 forbiddeb #492

intrepidsilence opened this issue Feb 17, 2024 · 2 comments
Labels

Comments

@intrepidsilence
Copy link

intrepidsilence commented Feb 17, 2024

What happened:

When running with any query it fails with a pool.py 403 forbidden error.

❯ howdoi format date bash
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 461, in _get_answer_worker
    answer = _get_answer(args, link)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 359, in _get_answer
    page = _get_result(link + '?answertab=votes')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 183, in _get_result
    resp.raise_for_status()
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script?answertab=votes
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/bin/howdoi", line 8, in <module>
    sys.exit(command_line_runner())
             ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 814, in command_line_runner
    howdoi_result = howdoi(args)
                    ^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 632, in howdoi
    res = _get_answers(args)
          ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 446, in _get_answers
    answers = pool.starmap(
              ^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/pool.py", line 375, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/pool.py", line 774, in get
    raise self._value
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script?answertab=votes

What you expected to happen:

get a valid result

Output with --explain

howdoi format date bash --explain
INFO: Version: 2.0.20
INFO: Fetching answers for query: format date bash
INFO: Using cached links
INFO: Links from stackoverflow.com found on google: 1
INFO: URL: https://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script
INFO: Answers requested: 1, Starting at position: 1
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 461, in _get_answer_worker
    answer = _get_answer(args, link)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 359, in _get_answer
    page = _get_result(link + '?answertab=votes')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 183, in _get_result
    resp.raise_for_status()
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script?answertab=votes
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/bin/howdoi", line 8, in <module>
    sys.exit(command_line_runner())
             ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 814, in command_line_runner
    howdoi_result = howdoi(args)
                    ^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 632, in howdoi
    res = _get_answers(args)
          ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/howdoi/2.0.20_6/libexec/lib/python3.12/site-packages/howdoi/howdoi.py", line 446, in _get_answers
    answers = pool.starmap(
              ^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/pool.py", line 375, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/pool.py", line 774, in get
    raise self._value
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script?answertab=votes
@renatocfrancisco
Copy link

@intrepidsilence my terminal didn't throw an error. have you tried uninstalling it? is it working now? issue solved?
WindowsTerminal_KXbbtpCA7g

@intrepidsilence
Copy link
Author

Seems to be working now. Not sure what changed. Thanks

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

2 participants