-
-
Notifications
You must be signed in to change notification settings - Fork 876
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
fix dictionary keys changed during iteration error seen in utils when using py3.8 #877
Conversation
…itiveDict class in py3.8
jira/utils/__init__.py
Outdated
if key != key.lower(): | ||
self[key.lower()] = value | ||
self.pop(key, None) | ||
# self.itemlist = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not leave commented out code. Remove it if it's no longer necessary.
jira/utils/__init__.py
Outdated
|
||
# self.itemlist[key.lower()] = value | ||
itemlist = {} | ||
for key, value in super(CaseInsensitiveDict, self).items(): | ||
itemlist[key.lower()] = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use a list of keys to remove and remove them in subsequent for loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you. Yes, that would be clearer actually and appears to work fine too:
def __init__(self, *args, **kw):
super(CaseInsensitiveDict, self).__init__(*args, **kw)
upper_keys_list = []
for key in super(CaseInsensitiveDict, self).keys():
if key != key.lower():
upper_keys_list.append(key)
for upper_key in upper_keys_list:
self[upper_key.lower()] = self[upper_key]
self.pop(upper_key, None)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM to me, but I don't have write access 😢
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Can this pull request be reopened? The bug prevents using the |
|
cc @ssbarnea (this seems like a candidate for review & merge). |
Oh come on, is it so hard to merge this? It still fails on latest master. |
@ssbarnea Can we merge this :-) ? |
Can this be merged? It's really a blocker |
seems the issue was already fixed in #895 , just hasn't been released |
Can we please have a release when? 🥺 I mean it have been 1/2 year |
|
we need this change, Why not work on it and release the change? |
Do you want to help? The project 's CI has broken and folks need a hand. That would be a more positive way to collaborate on a volunteer-basis project, instead of thumping your feet making demands. |
@russoz I think we can help as we are also affected, do you have the details on what is broken to ship this fix? |
Could we merge this fix, please ? |
No idea if people are still following this, but I've made a PR for the move to |
noticed this error when trying to upload a file in jira while using python 3.8 on MacOS 10.14.6:
Tested the fix below and there seems to not be any issues. File uploaded fine, no other errors: