-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Description
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
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 |