RedditRefresh icon indicating copy to clipboard operation
RedditRefresh copied to clipboard

Exception: invalid reponse code

Open aamaanaa opened this issue 1 month ago • 0 comments

Traceback (most recent call last):
  File "/home/fbi/git/RedditRefresh/main.py", line 29, in <module>
    main()
    ~~~~^^
  File "/home/fbi/git/RedditRefresh/main.py", line 24, in main
    redditRefresh.executeQuery()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/fbi/git/RedditRefresh/RedditRefresh.py", line 162, in executeQuery
    self.manageComments()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/home/fbi/git/RedditRefresh/RedditRefresh.py", line 128, in manageComments
    comment.edit(hashed_text)
    ~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/home/fbi/.local/lib/python3.13/site-packages/praw/models/reddit/mixins/editable.py", line 56, in edit
    updated = self._reddit.post(API_PATH["edit"], data=data)[0]
              ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fbi/.local/lib/python3.13/site-packages/praw/util/deprecate_args.py", line 46, in wrapped
    return func(**dict(zip(_old_args, args)), **kwargs)
  File "/home/fbi/.local/lib/python3.13/site-packages/praw/reddit.py", line 861, in post
    return self._objectify_request(
           ~~~~~~~~~~~~~~~~~~~~~~~^
        data=data,
        ^^^^^^^^^^
    ...<4 lines>...
        path=path,
        ^^^^^^^^^^
    )
    ^
  File "/home/fbi/.local/lib/python3.13/site-packages/praw/reddit.py", line 514, in _objectify_request
    self.request(
    ~~~~~~~~~~~~^
        data=data,
        ^^^^^^^^^^
    ...<4 lines>...
        path=path,
        ^^^^^^^^^^
    )
    ^
  File "/home/fbi/.local/lib/python3.13/site-packages/praw/util/deprecate_args.py", line 46, in wrapped
    return func(**dict(zip(_old_args, args)), **kwargs)
  File "/home/fbi/.local/lib/python3.13/site-packages/praw/reddit.py", line 963, in request
    return self._core.request(
           ~~~~~~~~~~~~~~~~~~^
        data=data,
        ^^^^^^^^^^
    ...<4 lines>...
        path=path,
        ^^^^^^^^^^
    )
    ^
  File "/home/fbi/.local/lib/python3.13/site-packages/prawcore/sessions.py", line 328, in request
    return self._request_with_retries(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        data=data,
        ^^^^^^^^^^
    ...<5 lines>...
        url=url,
        ^^^^^^^^
    )
    ^
  File "/home/fbi/.local/lib/python3.13/site-packages/prawcore/sessions.py", line 267, in _request_with_retries
    raise self.STATUS_EXCEPTIONS[response.status_code](response)
prawcore.exceptions.Forbidden: received 403 HTTP response

with special attention to this line:

    raise self.STATUS_EXCEPTIONS[response.status_code](response)
prawcore.exceptions.Forbidden: received 403 HTTP response

wich means 403 forbidden. possible rate limit time out i think. this must be updated to handle http response codes.

aamaanaa avatar Oct 29 '25 03:10 aamaanaa