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

Development mode server kills itself on syntax errors #681

Closed
dwt opened this issue Sep 6, 2012 · 11 comments
Closed

Development mode server kills itself on syntax errors #681

dwt opened this issue Sep 6, 2012 · 11 comments

Comments

@dwt
Copy link

dwt commented Sep 6, 2012

Hi there,

I've noticed an annoying feature of the development mode of pyramid, that is, it's server kills itself if it encounters a syntax error.

While that is certainly safe, what I think it should really do is just try again after the next file change (that usually fixes the syntax error....).

@goodwillcoding
Copy link
Member

A pull request would be awesome.

@pjenvey
Copy link
Member

pjenvey commented Sep 15, 2012

Matt Good just made a solution for this for Flask: https://github.com/mgood/flask-failsafe

@mcdonc
Copy link
Member

mcdonc commented Sep 17, 2012

Daniel Holth also created something a number of moons ago that we might dredge up. I don't have a link to it at the moment.

mcdonc added a commit that referenced this issue Oct 1, 2012
@mcdonc
Copy link
Member

mcdonc commented Oct 1, 2012

Anybody have a better idea than the one described by the commit above?

@Sapphire64
Copy link
Contributor

Well, I'm testing this right now.

  1. Too much description text.
  2. I would rather press ^C and restart manually than change my __init__ file.
  3. It doesn't restart when I'm fixing syntaxerror in my views.py file of starter project. But restarts when I'm changing pserve.py! :))
  4. When it 'freezes' on files check we don't handle ^C = showing useless traceback.

@mcdonc
Copy link
Member

mcdonc commented Oct 1, 2012

K, welp, I have no better ideas.

@mcdonc
Copy link
Member

mcdonc commented Oct 1, 2012

(the above things you described are all expected).

@Sapphire64
Copy link
Contributor

#698 - I'm sorry I don't know how to attach commit to this issue :)

@ejo
Copy link
Contributor

ejo commented Dec 2, 2012

The existing behavior, stopping the server on syntax errors, seems best to me. Sometimes after the error that stops the server, your next editing activity in your code returns it to a state that is runnable (sans syntax problems) but may not yet be ready or safe in some other way. Some of us might not want it actually running again until after a manual restart. Auto-restart after error could be made an option, but how about not default?

@dwt
Copy link
Author

dwt commented Dec 3, 2012

Maybe you are better of if you disable auto reloading at in your situation.

Because I would highly doubt that you can even guarantee a high probability that your code gets into situations where you don't want to run it only after you made a change that doesn't let the code compile / load anymore.

That being said, maybe the real solution for you may be to create a separate development environment where software failure does not have harsh consequences.

@domenkozar
Copy link
Member

I've opened #2044 as a possible solution. I've been using similar approach for auto-saving in my editor, so it doesn't save a synaxerror.

So I remembered pyramid pserve could also benefit from the same behavior.

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

No branches or pull requests

8 participants