Python Sanic Error: Segmentation fault (core dumped)

The error makes the Sanic server shut down silently.
import datetimeimport sanic
@app.route("/", methods=["GET"])
async def idnex(request: Request):
now = datetime.datetime.utcnow()
data = {"status": "OK", "data": now}
return sanic.response.json(body=res)
except Exception as e:
return sanic.response.json(
body={"status": "Error", "data": ""}




Data Engineer, NLP Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Coding is communicating

Establishing a Simple Web Server and Weather Station with ESP-32

How IAM Works — A Deep Dive In IAM’s Working

Unity Game Development — Getting Started with Post Processing

Dockerize Spark Jobs with Databricks Container Services

The Two Water Jug Puzzle

The Two Water Jugs — Problem Definition

Hello, Kubernetes Spring Boot

Image of Kubernetes logo.

Thanks, Mario, but the code needs fixing — checking TheXTech

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Data Engineer, NLP Engineer

More from Medium

Packaging & Tool Release

Python & Oracle Database Connection — A Simple Guide for Dataframe Creation

ParserError: Error tokenizing data. C error: EOF inside string starting at row 39665

How to use range() function in python.