Comments (6)
Possibly related, but the exception is different and the error happens every time, regardless if it is a syntax error or not: #213
from functions-framework-python.
Hi @filipre, this seems to be a VS Code issue: https://stackoverflow.com/q/52372810. It's not related to #213.
Can you try the workaround suggested and see if that works for you?
from functions-framework-python.
Thank you for your reply. The Stackoverflow thread shifts the question to "Why does the CLI debugger finishes with the exit code 3"? VS Code will always throw an exception, when python finishes with an error code. I think that's the correct behavior. For example, this code should not throw an exception
sys_exit(0)
But this one should
sys_exit(1)
I could disable "Uncaught Exceptions" but I do not want this because I would also ignore exceptions in my program code.
The exact line that causes the system exit 3
is
run_module_as_main(options.target, alter_argv=True)
and options.target is 'functions_framework'
. The method is defined (?) in runpy somewhere. The sys.path
looks correct, too and refers to the right virtual env packages and custom packages.
Is there something else I could provide to figure out the root of the problem?
from functions-framework-python.
I created https://github.com/filipre/vscode-debugger-exit-3-bug to debug the issue
Here are some observations:
- I think
run_module_as_main
always exits with error code3
and not just sometimes. - If I uncheck "Raised Exception", "Uncaught Exception" and "User Uncaught Exception", the debugger restarts without raising an exception
- If I then check "User Uncaught Exceptions", I can restart the debugger once but not twice or more times
- If I check "Uncaught Exceptions", it always raises an exception.
Maybe after changing a file, system_frameworks
does not "properly" stop the debugger and causes the exit code?
from functions-framework-python.
this error all about library's trigger method.
there is a default "trigger_reload" method and it raises SystemExit when file has been changed.
def trigger_reload(self, filename: str) -> None: self.log_reload(filename) sys.exit(3) #ย just make it disable in source code
or
`def your_trigger_method(fn): pass
reloader.trigger_reload = your_trigger_method`
from functions-framework-python.
this error all about library's trigger method.
Which library do you mean? functions-framework or something else?
from functions-framework-python.
Related Issues (20)
- Firebase Functions Support HOT 1
- Possibility for multiple target/signature-type pairs?
- Gunicorn 21 is out HOT 3
- Flask Celery worker raise RuntimeError(unbound_message) from None RuntimeError: Working outside of request context. HOT 2
- Add Flask 3 support HOT 2
- README.md - Flask "Request" object hyperlink is broken HOT 2
- Native support for Pydantic models for function_framework.typed
- Document functions_framework.typed
- Support for postponed annnotations
- Improve developer experience for uncaught exceptions on GCP HOT 1
- PyPi development status alpha and other classifiers HOT 1
- functions-framework and tuning gunicorn HOT 1
- enhance framework to support pull subscriptions in addition to push subscriptions with pubsub
- Memory leaks? HOT 2
- ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
- Bug: Firestore AggregationQuery stuck when running locally in Docker HOT 2
- Update type check in `get_user_function` to accept Callable instead of only types.FunctionType
- Blackduck scan showing HIGH level vulnerability on v3.5.0 HOT 1
- Sudden increase in memory usage from 3.5.0 to 3.6.0 HOT 10
- Version 3.8.0 breaks logging HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functions-framework-python.