Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

RuntimeError: dictionary keys changed during iteration #207

@tetractius

Description

@tetractius

Couldn't find a similar issue, so opening a new one as code here seems still to be affected, but please close if I am wrong.

While I was trying some examples of SmugMug from https://gist.github.com/smugmug-api-docs/10046914

It seems that Python3.8 does like dictionaries under his chair in utils.py (was working fine with Python3.7 before upgrade ubuntu):

Traceback (most recent call last):
  File "./main.py", line 52, in <module>
    main()
  File "./main.py", line 34, in main
    at, ats = service.get_access_token(rt, rts, params={'oauth_verifier': verifier})
  File "/home/tetractius/PycharmProjects/SmugmugPyAuth/venv/lib/python3.8/site-packages/rauth/service.py", line 332, in get_access_token
    process_token_request(r, decoder, key_token, key_token_secret)
  File "/home/tetractius/PycharmProjects/SmugmugPyAuth/venv/lib/python3.8/site-packages/rauth/service.py", line 20, in process_token_request
    data = decoder(r.content)
  File "/home/tetractius/PycharmProjects/SmugmugPyAuth/venv/lib/python3.8/site-packages/rauth/utils.py", line 26, in parse_utf8_qsl
    for k, v in d.items():  # pragma: no cover
RuntimeError: dictionary keys changed during iteration

I just tried to create a copy of the dictionary d for iteration-only purposes, and that seems to be enough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions