Description
In nw_server_status/server_status.py, the code uses the deprecated logging.warn() method instead of the correct logging.warning().
Location
File: nw_server_status/server_status.py
Line: 104
Current Code
logging.warn(f"Skipping {guild}...") # ❌ Deprecated
Impact
- Generates
DeprecationWarning in Python 3.x
logging.warn() has been deprecated since Python 3.2
- May be removed in future Python versions, breaking the code
Fix Required
Replace with the correct method:
logging.warning(f"Skipping {guild}...") # ✅ Correct
Priority
MEDIUM - Code still works but uses deprecated API.
Reference
From Python documentation:
Logger.warn() - Deprecated since Python 3.3, use warning() instead.
See: https://docs.python.org/3/library/logging.html#logging.Logger.warning
Testing
After fixing:
- Run the code and verify no deprecation warnings appear
- Verify logging still works correctly
Additional Notes
It's a simple one-line fix but improves code quality and future-proofing.
Related
This is part of a comprehensive code review. See other issues for additional improvements.
Description
In
nw_server_status/server_status.py, the code uses the deprecatedlogging.warn()method instead of the correctlogging.warning().Location
File:
nw_server_status/server_status.pyLine: 104
Current Code
Impact
DeprecationWarningin Python 3.xlogging.warn()has been deprecated since Python 3.2Fix Required
Replace with the correct method:
Priority
MEDIUM - Code still works but uses deprecated API.
Reference
From Python documentation:
See: https://docs.python.org/3/library/logging.html#logging.Logger.warning
Testing
After fixing:
Additional Notes
It's a simple one-line fix but improves code quality and future-proofing.
Related
This is part of a comprehensive code review. See other issues for additional improvements.