`client` not present in the scope of the interpreter invoked by doing `python manage.py mmclient`

Bug #1428169 reported by Ankush Sharma
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Postorius
Fix Released
Undecided
Ankush Sharma

Bug Description

While following up the docs of postorius here http://postorius.readthedocs.org/en/latest/development.html#accessing-the-mailman-api ; it has been mentioned that we can use the so called mailman's REST api `client` in the interpreter invoked by the command 'python manage.py mmclient`. The interpreter invocation works fine. But, in case of absence of IPython on the machine the `client` is not present in the scope of the invoked normal python shell. That is, the following error:

$ python manage.py mmclient
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)

>>> client
Traceback (most recent call last):
  File "<console>", line 1, in <module>
NameError: name 'client' is not defined

This bug is due to the fact that the `client` is not added to the `globals()` dictionary before passing it to `shell = code.InteractiveConsole(globals())` in line 44 of file http://bazaar.launchpad.net/~mailman-coders/postorius/trunk/view/head:/src/postorius/management/commands/mmclient.py .

Tags: postorius

Related branches

Revision history for this message
Abhishek (abhi170893) wrote :

I got this bug and as suggested in the description, after adding the client to the globals, things worked fine.

Changed in postorius:
status: New → Confirmed
assignee: nobody → Ankush Sharma (black-perl)
Changed in postorius:
status: Confirmed → Fix Committed
Changed in postorius:
milestone: none → 1.0.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.