0

It is pretty straight forward I run the python web2py.py in terminal (mac ox lion) and go to my controller. Before I had code which I thought was doing it, but now I only have a this left in my code and I'm still getting the problem:

def login():
    import pdb
    pdb.set_trace()
    value = 'test'
    return dict(test=value)

From this I'm then getting:

/Users/auser/web/public/applications/api/controllers/profile.py(10)login()
-> value = 'test'
(Pdb) Tcl_WaitForEvent: Notifier not initialized
Abort trap: 6

Does anyone know what is going on here. I'm using the standard flavour of python which comes with the Mac OSX - Python 2.7.1

The system hangs for a split second and then spits out the Abort Trap: 6. Then I get the "do you want to report this problem with python" suspect from mac osx because it thinks the world blew up. I don't know if web2py has a kill switch or what for pdb, however it is driving me insane.

pdb works fine when web2py is not involved I've tested that also.

I don't want to download winpdb as I have to switch the python environment (64 to 32) I'm in and I don't really want to do that and create another headache. Especially when it works without web2py?

Any help will be greatly appreciated.

Cheers,

Sententia

mehdi lotfi
  • 11,194
  • 18
  • 82
  • 128
Sententia
  • 625
  • 1
  • 6
  • 17

1 Answers1

0

I was going about it the wrong way. It must be trying to freeze the web2py server and causing a critical fault.

The way I'm using it now is in interactive shell mode which fixes the server environment problem - I can't believe I didn't try this earlier.

I use the same code:

def login():
    import pdb
    pdb.set_trace()
    value = 'test'
    return dict(test=value)

and use this at the terminal

python web2py.py --shell=/api/profile/login -M

It then breaks as it should.

Rage calming.....

Sententia
  • 625
  • 1
  • 6
  • 17