Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spammy massage - PyPy readlink #2983

Open
1 task done
Commandcracker opened this issue Jul 3, 2024 · 0 comments
Open
1 task done

Spammy massage - PyPy readlink #2983

Commandcracker opened this issue Jul 3, 2024 · 0 comments

Comments

@Commandcracker
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

The message:
PyPy: Skipping patching of the os module as it appears the 'readlink' function has been added.
is spammed when I launch sanic.

Describe the solution you'd like

Change the log type to debug or only display the message once.

Additional context

sanic/sanic/compat.py

Lines 81 to 95 in da1c646

def pypy_os_module_patch() -> None:
"""
The PyPy os module is missing the 'readlink' function, which causes issues
withaiofiles. This workaround replaces the missing 'readlink' function
with 'os.path.realpath', which serves the same purpose.
"""
if hasattr(os, "readlink"):
error_logger.warning(
"PyPy: Skipping patching of the os module as it appears the "
"'readlink' function has been added."
)
return
module = sys.modules["os"]
module.readlink = os.path.realpath # type: ignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant