jira icon indicating copy to clipboard operation
jira copied to clipboard

bug: config reading options editing JIRA.DEFAULT_OPTIONS

Open brezelman opened this issue 2 years ago • 5 comments

bug: don't edit JIRA.DEFAULT_OPTIONS, instead work with shallow copy.

brezelman avatar Jun 17 '22 09:06 brezelman

Good find, though I'm curious how you encountered this problem. Did you instantiate one JIRA-instance using get_jira and another one using the non-config way in your program?

Also, once #1394 gets merged this might still cause problems, as the config is then a nested dict. Might want to change it to copy.deepcopy.


Jannik Meinecke ([email protected]) on behalf of MBition GmbH. Provider Information

rynkk avatar Jun 21 '22 17:06 rynkk

Good find, though I'm curious how you encountered this problem.

I got an exception accessing self._options["headers"] in client.py:498, because self._options did not have the headers property.

Also, once #1394 gets merged this might still cause problems, as the config is then a nested dict. Might want to change it to copy.deepcopy.

I used copy.copy because it's also used in client.py:489. This needs to be changed to copy.deepcopy then, too, probably.

brezelman avatar Jun 21 '22 18:06 brezelman

#1394 is now merged, let's see if we can get a test case in while we are at it so we know we are fixing the right thing!

Let me know if you need any pointers, the tests can get a bit funky, my suggestion would be to put them in: https://github.com/pycontribs/jira/blob/main/tests/test_client.py

adehad avatar Jun 28 '22 21:06 adehad

@brezelman any update? Thank you for contributing

studioj avatar Feb 09 '23 20:02 studioj

@brezelman any update? Thank you for contributing

I'm sorry. I'm not able to provide a test implementation.

brezelman avatar Feb 14 '23 16:02 brezelman