-
-
Notifications
You must be signed in to change notification settings - Fork 884
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
Method add_attachment() error with python 3.8 -- RuntimeError: dictionary keys changed during iteration #890
Comments
FYI, this error comes from this change introduced in Python 3.8: It is not mentioned in the main changelog for Python 3.8 (https://docs.python.org/3/whatsnew/3.8.html), but IS mentioned in the "full" one (https://docs.python.org/3/whatsnew/changelog.html#changelog). |
Python 3.8 will thrown an exception if a dict changes while iterating over it, copy it first. Fix pycontribs#890
Python 3.8 will thrown an exception if a dict changes while iterating over it, copy it first. Fix #890
Dear JIRA Python API team, This issue is still surfacing despite the merge. My system's python version is PFB the stack trace.
Here is my code snippet
I don't want to downgrade python version. Regards |
@ssbarnea can you do a new release with this fix ? Thanks, |
Python 3.8 will thrown an exception if a dict changes while iterating over it, copy it first. Fix pycontribs#890
Dear JIRA Python API team, I got same issue. Exception: Thanks. |
This is fixed in 3.0 of this package - https://github.com/pycontribs/jira/releases/tag/3.0 |
Manually update lib to jira-3.0a1 and jira-3.0a2 from pip, but issue still reproduced. |
Hi,
If the issue is still reproduced, how will that helps me?
As you said, I still try to use the latest library jira-3.0a2
Thanks and regards,
Srinu
…On Wed, Nov 18, 2020 at 8:24 AM amaistrenko-od-ua ***@***.***> wrote:
Manually update lib to jira-3.0a1 and jira-3.0a2 from pip, but issue still
reproduced.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#890 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFKKI5EXMG5LVC5HWCU5DFTSQPRJHANCNFSM4KE4GP3Q>
.
|
It works when using the version 3.0 from GitHub In poetry's syntax: I don't know why it is still not released to pypi though. |
Hello all, Still seeing the 2.0 release in pypi as the latest. And the issue still arises with python 3.9. Any ETA on when the 3.0 release will push to pypi? |
Adding my name to the list of 'me too' since upgrading to python-3.8.x. I don't understand why this ticket is closed when there's no fix available yet? |
Adding attachments with version 3.0.1 with Python 3.9.5 is working. |
Python 3.8 will thrown an exception if a dict changes while iterating over it, copy it first. Fix pycontribs#890
Seems like Python 3.8 introduced change, which is causing issues in python-jira library when adding attachments: File "scripts/gitlab/prpl-jira.py", line 136, in build_failure self.jira.add_attachment( File "/usr/local/lib/python3.8/site-packages/jira/client.py", line 126, in wrapper result = func(*arg_list, **kwargs) File "/usr/local/lib/python3.8/site-packages/jira/client.py", line 787, in add_attachment url, data=m, headers=CaseInsensitiveDict({'content-type': m.content_type, 'X-Atlassian-Token': 'nocheck'}), retry_data=file_stream) File "/usr/local/lib/python3.8/site-packages/jira/utils/__init__.py", line 41, in __init__ for key, value in super(CaseInsensitiveDict, self).items(): RuntimeError: dictionary keys changed during iteration Until it's fixed upstream, workaround it by using Python 3.7, otherwise we would need to maintain our own fork of jira-python library. Ref: https://bugs.python.org/issue36452 Ref: pycontribs/jira#890 Signed-off-by: Petr Štetiar <[email protected]>
Describe the bug
When calling the add_attachment method in python 3.8, we hit RuntimeError: dictionary keys changed during iteration. We verified that rolling back to python 3.7, the same code works as expected.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
File attachement uploaded to JIRA and attached to issue.
Stack Trace
Version Information
Python Interpreter: 3.8
jira-python: 2.0.0
OS: Windows 10
IPython (Optional):
Other Dependencies:
Additional context
None
The text was updated successfully, but these errors were encountered: