Skip to content
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

Problems with debuggers (ipdb/pdb) #504

Closed
dangusev opened this issue May 17, 2017 · 2 comments
Closed

Problems with debuggers (ipdb/pdb) #504

dangusev opened this issue May 17, 2017 · 2 comments
Labels

Comments

@dangusev
Copy link

Hi! Hug is awesome, thank you!
But I have a problem with ipdb/pdb debugger in api. When I try to use them in endpoints I have exceptions.
I use python 3.6.1, hug 2.3.0

For example:

@hug.get('/test/ipdb/')
def test_ipdb():
    import ipdb; ipdb.set_trace()
curl localhost:8000/test/ipdb/


--Return--
None
> /home/dan/projects/flowy/flowy/api/entrypoint.py(15)test_ipdb()
     14 def test_ipdb():
---> 15     import ipdb; ipdb.set_trace()
     16 

ipdb> 
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/home/dan/venvs/flowy/lib/python3.6/site-packages/falcon/api.py", line 227, in __call__
    responder(req, resp, **params)
  File "/home/dan/venvs/flowy/lib/python3.6/site-packages/hug/interface.py", line 659, in __call__
    self.render_content(self.call_function(input_parameters), request, response, **kwargs)
  File "/home/dan/venvs/flowy/lib/python3.6/site-packages/hug/interface.py", line 600, in call_function
    return self.interface(**parameters)
  File "/home/dan/venvs/flowy/lib/python3.6/site-packages/hug/interface.py", line 99, in __call__
    return __hug_internal_self._function(*args, **kwargs)
  File "/home/dan/projects/flowy/flowy/api/entrypoint.py", line 15, in test_ipdb
    import ipdb; ipdb.set_trace()
  File "/usr/local/lib/python3.6/bdb.py", line 52, in trace_dispatch
    return self.dispatch_return(frame, arg)
  File "/usr/local/lib/python3.6/bdb.py", line 96, in dispatch_return
    if self.quitting: raise BdbQuit
bdb.BdbQuit
127.0.0.1 - - [17/May/2017 02:17:47] "GET /test/ipdb/ HTTP/1.1" 500 59
@timothycrosley
Copy link
Collaborator

Hi @dangusev,

This is a problem caused by the auto re-loader, you can bypass it for now by running with the --manual_reload option, long term it should be fixed to allow PDBs while auto reload is enabled.

Thanks!

~Timothy

@timothycrosley
Copy link
Collaborator

This should be fixed in the latest release to work without any extra options.

Thanks!

~Timothy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants