Pylons / pyramid

Pyramid - A Python web framework
https://trypyramid.com/
Other
3.97k stars 887 forks source link

Fix p* scripts to produce an error when given a bad config_uri #3766

Open kpinc opened 2 months ago

kpinc commented 2 months ago

When a bad settings URI (usually a path to a non-existant file) is supplied to one of pyramid's command line programs, and in general when there is a reason why a settings file cannot be used, produce an error message instead of a traceback.

Applications which import pyramid.paster must handle the plaster.exceptions.PlasterError exception themselves.

kpinc commented 2 months ago

I have changed the github workflow to get this to pass CI. This change is unrelated to the purpose of the patch. (macos-11 is no longer offered.)

kpinc commented 2 months ago

To see what this fixes, try:pserve /tmp/nonexistantfile You get a traceback without this patch.