jira
jira copied to clipboard
Jira is not defined
Bug summary
Run py script in jirashell, it's show Exception: jira is not defined
, but when I use globals().update(locals())
to merge locals variables into globals, the jira client go on.
May it's a bug or not?
Is there an existing issue for this?
- [X] I have searched the existing issues
Jira Instance type
Jira Cloud (Hosted by Atlassian)
Jira instance version
No response
jira-python version
3.5.2
Python Interpreter version
3.11.6
Which operating systems have you used?
- [ ] Linux
- [X] macOS
- [ ] Windows
Reproduction steps
1. Prepare a python file `jira_export.py`, and contain `print(jira.issue)` code.
2. Run jirashell into
3. Run `with open('jira_export.py') as f: exec(f.read())`
4. Show error `Exception: jira is not defined`
5. Run `globals().update(locals())`
6. Print the jira.issue object
Stack trace
In [4]: with open('jira_export.py') as f: exec(f.read())
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
Cell In[4], line 1
----> 1 with open('jira_export.py') as f: exec(f.read())
File <string>:13
Exception: jira is not defined
In [5]: globals().update(locals())
In [6]: with open('jira_export.py') as f: exec(f.read())
issues: 0
Expected behaviour
Not throw exception.
Additional Context
No response
If you could provide an example of the python file that might be easier for someone to have a look.
I haven't used the jirashell interface myself but perhaps someone else might be able to spot anything unusual in either the file or our code.