# Buggy code
async def command_llsetup_java(self, ctx: commands.Context, *, java_path: str = None):
    """Change your Java executable path

    Enter nothing to reset to default.
    """
    external = await self.config.use_external_lavalink()
    if external:
        return await self.send_embed_msg(
            ctx,
            title=_("Invalid Environment"),
            description=_(
                "You cannot changed the Java executable path of "
                "external Lavalink instances from the Audio Cog."
            ),
        )
    if java_path is None:
        await self.config.java_exc_path.clear()
        await self.send_embed_msg(
            ctx,
            title=_("Java Executable Reset"),
            description=_("Audio will now use `java` to run your Lavalink.jar"),
        )
    else:
        exc = Path(java_path)
        exc_absolute = exc.absolute()
        if not exc.exists() or not exc.is_file():
            return await self.send_embed_msg(
                ctx,
                title=_("Invalid Environment"),
                description=_("`{java_path}` is not a valid executable").format(
                    java_path=exc_absolute
                ),
            )
        await self.config.java_exc_path.set(exc_absolute)
        await self.send_embed_msg(
            ctx,
            title=_("Java Executable Changed"),
            description=_("Audio will now use `{exc}` to run your Lavalink.jar").format(
                exc=exc_absolute
            ),
        )
    try:
        if self.player_manager is not None:
            await self.player_manager.shutdown()
    except ProcessLookupError:
        await self.send_embed_msg(
            ctx,
            title=_("Failed To Shutdown Lavalink"),
            description=_(
                "For it to take effect please reload Audio (`{prefix}reload audio`)."
            ).format(
                prefix=ctx.prefix,
            ),
        )
    else:
        try:
            self.lavalink_restart_connect()
        except ProcessLookupError:
            await self.send_embed_msg(
                ctx,
                title=_("Failed To Shutdown Lavalink"),
                description=_("Please reload Audio (`{prefix}reload audio`).").format(
                    prefix=ctx.prefix
                ),
            )


# Traceback (TypeError)
[2020-11-18 18:44:58] [ERROR] red: TypeError
Traceback (most recent call last):
File "/home/red/envs/eevee/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/red/envs/eevee/lib/python3.8/site-packages/redbot/cogs/audio/core/commands/llset.py", line 58, in command_llsetup_java
await self.config.java_exc_path.set(exc_absolute)
File "/home/red/envs/eevee/lib/python3.8/site-packages/redbot/core/config.py", line 257, in set
await self.driver.set(self.identifier_data, value=value)
File "/home/red/envs/eevee/lib/python3.8/site-packages/redbot/core/drivers/json.py", line 146, in set
value_copy = json.loads(json.dumps(value))
File "/usr/lib/python3.8/json/init.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python3.8/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.8/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.8/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type PosixPath is not JSON serializable

# Fixed code
async def command_llsetup_java(self, ctx: commands.Context, *, java_path: str = None):
    """Change your Java executable path

    Enter nothing to reset to default.
    """
    external = await self.config.use_external_lavalink()
    if external:
        return await self.send_embed_msg(
            ctx,
            title=_("Invalid Environment"),
            description=_(
                "You cannot changed the Java executable path of "
                "external Lavalink instances from the Audio Cog."
            ),
        )
    if java_path is None:
        await self.config.java_exc_path.clear()
        await self.send_embed_msg(
            ctx,
            title=_("Java Executable Reset"),
            description=_("Audio will now use `java` to run your Lavalink.jar"),
        )
    else:
        exc = Path(java_path)
        exc_absolute = exc.absolute()
        if not exc.exists() or not exc.is_file():
            return await self.send_embed_msg(
                ctx,
                title=_("Invalid Environment"),
                description=_("`{java_path}` is not a valid executable").format(
                    java_path=exc_absolute
                ),
            )
        await self.config.java_exc_path.set(str(exc_absolute))
        await self.send_embed_msg(
            ctx,
            title=_("Java Executable Changed"),
            description=_("Audio will now use `{exc}` to run your Lavalink.jar").format(
                exc=exc_absolute
            ),
        )
    try:
        if self.player_manager is not None:
            await self.player_manager.shutdown()
    except ProcessLookupError:
        await self.send_embed_msg(
            ctx,
            title=_("Failed To Shutdown Lavalink"),
            description=_(
                "For it to take effect please reload Audio (`{prefix}reload audio`)."
            ).format(
                prefix=ctx.prefix,
            ),
        )
    else:
        try:
            self.lavalink_restart_connect()
        except ProcessLookupError:
            await self.send_embed_msg(
                ctx,
                title=_("Failed To Shutdown Lavalink"),
                description=_("Please reload Audio (`{prefix}reload audio`).").format(
                    prefix=ctx.prefix
                ),
            )