# Buggy code
def __init__(
    self,
    name=None,
    router=None,
    error_handler=None,
    load_env=True,
    request_class=None,
    strict_slashes=False,
    log_config=None,
    configure_logging=True,
):
    # Get name from previous stack frame
    if name is None:
        frame_records = stack()[1]
        name = getmodulename(frame_records[1])

    # logging
    if configure_logging:
        logging.config.dictConfig(log_config or LOGGING_CONFIG_DEFAULTS)

    self.name = name
    self.asgi = False
    self.router = router or Router()
    self.request_class = request_class
    self.error_handler = error_handler or ErrorHandler()
    self.config = Config(load_env=load_env)
    self.request_middleware = deque()
    self.response_middleware = deque()
    self.blueprints = {}
    self._blueprint_order = []
    self.configure_logging = configure_logging
    self.debug = None
    self.sock = None
    self.strict_slashes = strict_slashes
    self.listeners = defaultdict(list)
    self.is_running = False
    self.is_request_stream = False
    self.websocket_enabled = False
    self.websocket_tasks = set()

    # Register alternative method names
    self.go_fast = self.run


# Traceback (TypeError)
[2019-06-05 03:32:59 +0000] [10] [ERROR] Exception occurred while handling uri: 'http://localhost:5000/'
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sanic/app.py", line 906, in handle_request
handler.__name__
File "/usr/local/lib/python3.7/site-packages/sanic/app.py", line 1355, in _build_endpoint_name
return ".".join(parts)
TypeError: sequence item 0: expected str instance, NoneType found
[2019-06-05 03:32:59 +0000] - (sanic.access)[INFO][172.17.0.1:55388]: GET http://localhost:5000/  500 144

# Fixed code
def __init__(
    self,
    name=None,
    router=None,
    error_handler=None,
    load_env=True,
    request_class=None,
    strict_slashes=False,
    log_config=None,
    configure_logging=True,
):
    # Get name from previous stack frame
    if name is None:
        warnings.warn(
            "Sanic(name=None) is deprecated and None value support "
            "for `name` will be removed in the next release. "
            "Please use Sanic(name='your_application_name') instead.",
            DeprecationWarning,
            stacklevel=2,
        )
        frame_records = stack()[1]
        name = getmodulename(frame_records[1])

    # logging
    if configure_logging:
        logging.config.dictConfig(log_config or LOGGING_CONFIG_DEFAULTS)

    self.name = name
    self.asgi = False
    self.router = router or Router()
    self.request_class = request_class
    self.error_handler = error_handler or ErrorHandler()
    self.config = Config(load_env=load_env)
    self.request_middleware = deque()
    self.response_middleware = deque()
    self.blueprints = {}
    self._blueprint_order = []
    self.configure_logging = configure_logging
    self.debug = None
    self.sock = None
    self.strict_slashes = strict_slashes
    self.listeners = defaultdict(list)
    self.is_running = False
    self.is_request_stream = False
    self.websocket_enabled = False
    self.websocket_tasks = set()

    # Register alternative method names
    self.go_fast = self.run